From cc303028fc9843fa3789d2ecdda0e5b11aec2e32 Mon Sep 17 00:00:00 2001 From: Pierre Muller Date: Tue, 5 Nov 2002 08:25:13 +0000 Subject: [PATCH] 2002-10-07 Pierre Muller * values.c (value_change_enclosing_type): Set enclosing_type field correctly also for the case where more memory needs to be allocated. --- gdb/ChangeLog | 6 ++++++ gdb/values.c | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index e1400e0270a..29714984f40 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2002-11-05 Pierre Muller + + * values.c (value_change_enclosing_type): Set + enclosing_type field correctly also for the case where + more memory needs to be allocated. + 2002-11-03 Mark Kettenis * i387-tdep.c (i387_print_float_info): Call fputs_filtered instead diff --git a/gdb/values.c b/gdb/values.c index c943f28fa46..950dee68e99 100644 --- a/gdb/values.c +++ b/gdb/values.c @@ -862,7 +862,9 @@ value_change_enclosing_type (struct value *val, struct type *new_encl_type) struct value *prev; new_val = (struct value *) xrealloc (val, sizeof (struct value) + TYPE_LENGTH (new_encl_type)); - + + VALUE_ENCLOSING_TYPE (new_val) = new_encl_type; + /* We have to make sure this ends up in the same place in the value chain as the original copy, so it's clean-up behavior is the same. If the value has been released, this is a waste of time, but there -- 2.30.2