Only read the right number of bytes in reading basetypes, so we don't

overrun malloc.
This commit is contained in:
John Gilmore 1991-08-03 02:02:03 +00:00
parent c5c604c446
commit 4f6f12f989
2 changed files with 5 additions and 1 deletions

View File

@ -1,5 +1,9 @@
Fri Aug 2 00:13:06 1991 John Gilmore (gnu at cygint.cygnus.com)
* values.c (basetype_addr): When reading target memory, use the
length of the basetype, not the upper type. We've only malloc'd
enough space for the basetype, leading to errors in free().
* expprint.c (print_subexp): Print UNOP_MEMVAL of an OP_LONG that
ends up as a function specially, since we know the actual type of
the pointed-to address. This (somewhat) fixes display of

View File

@ -1179,7 +1179,7 @@ baseclass_addr (type, index, valaddr, valuep, errp)
status = target_read_memory (addr,
VALUE_CONTENTS_RAW (val),
TYPE_LENGTH (type));
TYPE_LENGTH (basetype));
VALUE_LVAL (val) = lval_memory;
VALUE_ADDRESS (val) = addr;