aboutsummaryrefslogtreecommitdiff
path: root/gdb/value.c
diff options
context:
space:
mode:
authorSanimir Agovic <sanimir.agovic@intel.com>2013-10-14 08:36:13 +0100
committerSanimir Agovic <sanimir.agovic@intel.com>2014-04-11 13:43:51 +0100
commitbcd629a44fff61527430f353cf77e20fe3afc395 (patch)
treeb66b31d1a1fa0db37c61e17b2abeb23222d01b52 /gdb/value.c
parent04b19544ef6a97b62b2cc4a3170b900e046ab185 (diff)
downloadgdb-bcd629a44fff61527430f353cf77e20fe3afc395.zip
gdb-bcd629a44fff61527430f353cf77e20fe3afc395.tar.gz
gdb-bcd629a44fff61527430f353cf77e20fe3afc395.tar.bz2
vla: update type from newly created value
Constructing a value based on a type and address might change the type of the newly constructed value. Thus re-fetch type via value_type to ensure we have the correct type at hand. * ada-lang.c (ada_value_primitive_packed_val): Re-fetch type from value. (ada_template_to_fixed_record_type_1): Likewise. (ada_to_fixed_type_1): Likewise. * cp-valprint.c (cp_print_value_fields_rtti): Likewise. (cp_print_value): Likewise. * d-valprint.c (dynamic_array_type): Likewise. * eval.c (evaluate_subexp_with_coercion): Likewise. * findvar.c (address_of_variable): Likewise. * jv-valprint.c (java_value_print): Likewise. * valops.c (value_ind): Likewise. * value.c (coerce_ref): Likewise.
Diffstat (limited to 'gdb/value.c')
-rw-r--r--gdb/value.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/gdb/value.c b/gdb/value.c
index 9cc5e44..d125a09 100644
--- a/gdb/value.c
+++ b/gdb/value.c
@@ -3505,6 +3505,7 @@ coerce_ref (struct value *arg)
retval = value_at_lazy (enc_type,
unpack_pointer (value_type (arg),
value_contents (arg)));
+ enc_type = value_type (retval);
return readjust_indirect_value_type (retval, enc_type,
value_type_arg_tmp, arg);
}