From 53284144e71543d3f640045efd71820f82354793 Mon Sep 17 00:00:00 2001 From: Joel Brobecker Date: Wed, 2 Jan 2008 12:03:06 +0000 Subject: [PATCH] * 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. --- gdb/ChangeLog | 8 ++++++++ gdb/ada-lang.c | 6 +++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index e2784e8949..e3b9714a06 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,13 @@ 2008-01-02 Joel Brobecker + * 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 + * ada-lang.c (ada_value_equal): Dereference reference types when comparing arrays. diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index b3090a301c..6db11265cc 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -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, -- 2.11.0