diff options
Diffstat (limited to 'gdb/eval.c')
-rw-r--r-- | gdb/eval.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -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.")); |