* ada-lang.c (ada_evaluate_subexp): Modify the value returned

when noside is EVAL_AVOID_SIDE_EFFECTS to be an lval_memory.
        This is needed to make sure that any other treatment applied
        to the resulting value does not fail for spurious reason,
        such as trying to take the address of this value.
This commit is contained in:
Joel Brobecker 2008-01-02 12:03:06 +00:00
parent c4359f8d00
commit 0a07e705b7
2 changed files with 11 additions and 3 deletions

View File

@ -1,3 +1,11 @@
2008-01-02 Joel Brobecker <brobecker@adacore.com>
* ada-lang.c (ada_evaluate_subexp): Modify the value returned
when noside is EVAL_AVOID_SIDE_EFFECTS to be an lval_memory.
This is needed to make sure that any other treatment applied
to the resulting value does not fail for spurious reason,
such as trying to take the address of this value.
2008-01-02 Joel Brobecker <brobecker@adacore.com>
* ada-lang.c (ada_value_equal): Dereference reference types when

View File

@ -8397,7 +8397,7 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp,
if (arity != nargs)
error (_("wrong number of subscripts; expecting %d"), arity);
if (noside == EVAL_AVOID_SIDE_EFFECTS)
return allocate_value (ada_aligned_type (type));
return value_zero (ada_aligned_type (type), lval_memory);
return
unwrap_value (ada_value_subscript
(argvec[0], nargs, argvec + 1));
@ -8409,7 +8409,7 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp,
if (type == NULL)
error (_("element type of array unknown"));
else
return allocate_value (ada_aligned_type (type));
return value_zero (ada_aligned_type (type), lval_memory);
}
return
unwrap_value (ada_value_subscript
@ -8423,7 +8423,7 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp,
if (type == NULL)
error (_("element type of array unknown"));
else
return allocate_value (ada_aligned_type (type));
return value_zero (ada_aligned_type (type), lval_memory);
}
return
unwrap_value (ada_value_ptr_subscript (argvec[0], type,