* ada-lang.c (ada_evaluate_subexp) <BINOP_DIV>: make sure to
authorJoel Brobecker <brobecker@gnat.com>
Fri, 13 Mar 2009 02:15:01 +0000 (02:15 +0000)
committerJoel Brobecker <brobecker@gnat.com>
Fri, 13 Mar 2009 02:15:01 +0000 (02:15 +0000)
        promote the operands when noside is EVAL_AVOID_SIDE_EFFECTS.

gdb/ChangeLog
gdb/ada-lang.c

index 93b6b555dd9c52192dde14b6cdfb14630d379773..4307293898e4abfef78bf40360d5c2e4de7b6870 100644 (file)
@@ -1,3 +1,8 @@
+2009-03-12  Joel Brobecker  <brobecker@adacore.com>
+
+       * ada-lang.c (ada_evaluate_subexp) <BINOP_DIV>: make sure to
+       promote the operands when noside is EVAL_AVOID_SIDE_EFFECTS.
+
 2009-03-12  Joel Brobecker  <brobecker@adacore.com>
 
        * ada-tasks.c (ada_task_is_alive): Move up and make static.
index aa5deceb9b5bdd799716c1dfb72d49178fb1025f..f1a42680fd9550b813fcac2df287e98ea8df90d4 100644 (file)
@@ -8458,7 +8458,10 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp,
         goto nosideret;
       else if (noside == EVAL_AVOID_SIDE_EFFECTS
                && (op == BINOP_DIV || op == BINOP_REM || op == BINOP_MOD))
-        return value_zero (value_type (arg1), not_lval);
+        {
+          binop_promote (exp->language_defn, exp->gdbarch, &arg1, &arg2);
+          return value_zero (value_type (arg1), not_lval);
+        }
       else
         {
           type = builtin_type (exp->gdbarch)->builtin_double;