This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFA] Fix an error in value_change_enclosing_type




the function value_change_enclosing_type
does not set the enlclosing_type field correctly if
the new_encl_type has a bigger length that the value type.

Its seems quite astonishing that this has not been noticed before, 
but I discovered it when trying to get 
the fpc-abi.c code to work correctly.

ChangeLog entry:

2002-10-07  Pierre Muller  <muller@ics.u-strasbg.fr>

        * values.c (value_change_enclosing_type): Set 
        enclosing_type field correctly also for the case where 
        more memory needs to be allocated.


$ cvs diff -u -p values.c
Index: values.c
===================================================================
RCS file: /cvs/src/src/gdb/values.c,v
retrieving revision 1.41
diff -u -p -r1.41 values.c
--- values.c    18 Sep 2002 15:43:47 -0000      1.41
+++ values.c    7 Oct 2002 11:36:15 -0000
@@ -862,7 +862,9 @@ value_change_enclosing_type (struct valu
       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


Pierre Muller
Institut Charles Sadron
6,rue Boussingault
F 67083 STRASBOURG CEDEX (France)
mailto:muller@ics.u-strasbg.fr
Phone : (33)-3-88-41-40-07  Fax : (33)-3-88-41-40-99


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]