From bcd629a44fff61527430f353cf77e20fe3afc395 Mon Sep 17 00:00:00 2001 From: Sanimir Agovic Date: Mon, 14 Oct 2013 08:36:13 +0100 Subject: 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. --- gdb/eval.c | 1 + 1 file changed, 1 insertion(+) (limited to 'gdb/eval.c') diff --git a/gdb/eval.c b/gdb/eval.c index 1f4c869..1074e1d 100644 --- a/gdb/eval.c +++ b/gdb/eval.c @@ -2984,6 +2984,7 @@ evaluate_subexp_with_coercion (struct expression *exp, { (*pos) += 4; val = address_of_variable (var, exp->elts[pc + 1].block); + type = value_type (val); return value_cast (lookup_pointer_type (TYPE_TARGET_TYPE (type)), val); } -- cgit v1.1