[PATCH 2/3] bitpos: Additional checks to ensure that a type fits into size_t

Siddhesh Poyarekar siddhesh@redhat.com
Sat Aug 11 05:44:00 GMT 2012


Hi,

This is the updated patch based on Jan's suggestions for change. I have
not consolidated the error messages for the argument overflow and the
generic size_t overflows (or more accurately, size_t/8 overflow)
because the error text is different.

It builds correctly and does not cause regressions in the testsuite.

Regards,
Siddhesh

gdb/ChangeLog

2012-08-11  Siddhesh Poyarekar  <siddhesh@redhat.com>

	* alpha-tdep.c (alpha_push_dummy_call) Ensure that ARG_TYPE fits
	into size_t.  Check for overflow in ACCUMULATE_SIZE.
	* avr-tdep.c (avr_push_dummy_call): Ensure TYPE fits into
	size_t.
	* cp-valprint (cp_print_value): Ensure BASECLASS fits into
	size_t.
	* cris-tdep.c (cris_push_dummy_call): Ensure that arguments fit
	into size_t.
	* findcmd.c (parse_find_args): Ensure type of V fits into
	size_t.
	* gdbtypes.c (type_fits_size_t_or_error): New function that
	throws an error if a type length is larger than size_t / 8.
	* gdbtypes.h (type_fits_size_t_or_error): Likewise.
	* h8300-tdep.c (h8300_push_dummy_call): Ensure TYPE fits into
	size_t.
	(h8300h_return_value): Likewise.
	* m88k-tdep.c (m88k_store_arguments): Likewise.
	* p-valprint (pascal_object_print_value): Ensure BASECLASS fits
	into size_t.
	* sh-tdep.c (sh_push_dummy_call_fpu): Expand REG_SIZE.  Ensure
	TYPE fits into size_t.
	(sh_push_dummy_call_nofpu): Likewise.
	* valops.c (search_struct_method): Ensure BASECLASS fits into
	size_t.
	* value.c (allocate_value_lazy): Ensure TYPE fits into size_t.
	(allocate_value_contents): Likewise.
	(set_value_enclosing_type): Ensure NEW_ENCL_TYPE fits into
	size_t.
	* xstormy16-tdep.c (xstormy16_push_dummy_call): Ensure that each
	argument fits into size_t.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: bitpos-expand-ensure-sizet-2.patch
Type: text/x-patch
Size: 9089 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20120811/733d845b/attachment.bin>


More information about the Gdb-patches mailing list