This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH: Fix assorted bounds violations
- To: Greg McGary <greg at mcgary dot org>
- Subject: Re: PATCH: Fix assorted bounds violations
- From: Jeffrey A Law <law at cygnus dot com>
- Date: Thu, 31 Aug 2000 10:25:56 -0600
- cc: gcc-patches at gcc dot gnu dot org
- Reply-To: law at cygnus dot com
In message <msn1hvod19.fsf@mcgary.org>you write:
> > Or are we indeed resizing items within the realloc'd buffer too?
>
> Yes, we are--at least for now.
OK. I missed that. Sigh. How gross.
You should include a comment in the patch indicating that items inside
the realloc'd buffer are also being resized and thus need their bounds
updated.
With that comment I would consider the cpp patch OK.
> 1) that this is a call to an allocator (the malloc attribute might
> be sufficient),
Right. I'm not sure if we can (or even should) be marking the GGC
with a malloc attribute. If we do, that might simplify this code.
> 2) how to identify which args to the allocator bear on object
> size, and what formula computes the size.
I believe we can easily figure out this stuff for GGC allocated
items. It almost makes me thing we should consider a way to tell
the BP code that a function is malloc-like *and* how to get the size
of the object allocated.
But in the short term, I guess your patch is OK. Please install it.
Thanks,
jeff