summaryrefslogtreecommitdiff
path: root/gdb/eval.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/eval.c')
-rw-r--r--gdb/eval.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gdb/eval.c b/gdb/eval.c
index f4b39cbc2b0..d7f80e2d4f5 100644
--- a/gdb/eval.c
+++ b/gdb/eval.c
@@ -2929,12 +2929,12 @@ evaluate_subexp_for_address (struct expression *exp, int *pos,
{
struct type *type = check_typedef (value_type (x));
- if (VALUE_LVAL (x) == lval_memory || value_must_coerce_to_target (x))
- return value_zero (lookup_pointer_type (value_type (x)),
- not_lval);
- else if (TYPE_CODE (type) == TYPE_CODE_REF)
+ if (TYPE_CODE (type) == TYPE_CODE_REF)
return value_zero (lookup_pointer_type (TYPE_TARGET_TYPE (type)),
not_lval);
+ else if (VALUE_LVAL (x) == lval_memory || value_must_coerce_to_target (x))
+ return value_zero (lookup_pointer_type (value_type (x)),
+ not_lval);
else
error (_("Attempt to take address of "
"value not located in memory."));