Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFA] Fix an error in value_change_enclosing_type
@ 2002-10-07  4:37 Pierre Muller
  2002-10-18 14:08 ` Elena Zannoni
  0 siblings, 1 reply; 7+ messages in thread
From: Pierre Muller @ 2002-10-07  4:37 UTC (permalink / raw)
  To: gdb-patches




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


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2002-11-05  8:26 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-10-07  4:37 [RFA] Fix an error in value_change_enclosing_type Pierre Muller
2002-10-18 14:08 ` Elena Zannoni
2002-10-20 14:55   ` muller
2002-10-22 14:42     ` Elena Zannoni
2002-10-29  1:07       ` Pierre Muller
2002-11-03 16:09         ` Elena Zannoni
2002-11-05  0:26           ` Pierre Muller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox