This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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]

Re: [PING] [PATCH] c/71392 - SEGV calling integer overflow built-ins with a null pointer


On Thu, 9 Jun 2016, Martin Sebor wrote:

> Attached is an updated version of the original patch described
> below to annotate with the nonnull attribute the Built-In Functions
> to Perform Arithmetic with Overflow Checking.
> 
> Since the machinery that's in place doesn't handle the attribute
> on type-generic built-ins changes to the (handle_nonnull_attribute
> function in Ada and LTO besides C were required so I CC the
> maintainers for these areas.

The LTO bits are ok.

Richard.

> Thanks
> Martin
> 
> On 06/02/2016 05:22 PM, Martin Sebor wrote:
> > In a discussion of a patch in a this area (c/68120 and c++/70507)
> > Jakub noticed that the integer arithmetic built-ins with overflow
> > checking that expect a pointer to an integer as the last argument
> > silently (i.e., without a warning) accept a null pointer.  As the
> > test case in the bug referenced in in subject shows, such calls
> > then crash at runtime.
> > 
> > The attached patch follows the same approach used by other built
> > ins that take a pointer to an object (such as __built_strlen) to
> > issue a -Wnonnull warning for such invalid calls.
> > 
> > Martin
> 
> 

-- 
Richard Biener <rguenther@suse.de>
SUSE LINUX GmbH, GF: Felix Imendoerffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nuernberg)


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