diff options
author | Joel Brobecker <brobecker@gnat.com> | 2008-05-09 23:50:41 +0000 |
---|---|---|
committer | Joel Brobecker <brobecker@gnat.com> | 2008-05-09 23:50:41 +0000 |
commit | 003f3813535065a6b52d36b55443e43a59961238 (patch) | |
tree | ecc9af6b979fabcbf280afcb54f52b9b381250c7 | |
parent | 35903be00caecb8248eb38414b3fad3fee65fbe8 (diff) | |
download | binutils-003f3813535065a6b52d36b55443e43a59961238.zip binutils-003f3813535065a6b52d36b55443e43a59961238.tar.gz binutils-003f3813535065a6b52d36b55443e43a59961238.tar.bz2 |
* ada-lang.c (ada_evaluate_subexp) [BINOP_ASSIGN]: Do not force
the type of the right hand side of the assignment to the type
of the left hand side if the left hand side is a convenience
variable.
-rw-r--r-- | gdb/ChangeLog | 7 | ||||
-rw-r--r-- | gdb/ada-lang.c | 9 |
2 files changed, 15 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 5b61464..8acf37a 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,10 @@ +2008-05-09 Joel Brobecker <brobecker@adacore.com> + + * ada-lang.c (ada_evaluate_subexp) [BINOP_ASSIGN]: Do not force + the type of the right hand side of the assignment to the type + of the left hand side if the left hand side is a convenience + variable. + 2008-05-09 Ulrich Weigand <uweigand@de.ibm.com> * NEWS: Mention gdbserver bi-arch capability. diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index 8206f94..8f710f4 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -8558,7 +8558,14 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp, return arg1; return ada_value_assign (arg1, arg1); } - arg2 = evaluate_subexp (value_type (arg1), exp, pos, noside); + /* Force the evaluation of the rhs ARG2 to the type of the lhs ARG1, + except if the lhs of our assignment is a convenience variable. + In the case of assigning to a convenience variable, the lhs + should be exactly the result of the evaluation of the rhs. */ + type = value_type (arg1); + if (VALUE_LVAL (arg1) == lval_internalvar) + type = NULL; + arg2 = evaluate_subexp (type, exp, pos, noside); if (noside == EVAL_SKIP || noside == EVAL_AVOID_SIDE_EFFECTS) return arg1; if (ada_is_fixed_point_type (value_type (arg1))) |