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: [PATCH] Don't segv in vtable verification with ubsan (PR sanitizer/59415)


On Mon, Dec 09, 2013 at 03:23:30PM +0100, Marek Polacek wrote:
> We ICEd on the following testcase with -fsanitize=null and vtable
> verification on, because gimple_call_fn returns NULL for UBSAN_*
> internal functions.  Fixed by checking the result for NULL before
> accessing its TREE_CODE.
> 
> Regtested/bootstrapped on x86_64-linux, ok for trunk?

Ok.
> 2013-12-09  Marek Polacek  <polacek@redhat.com>
> 
> 	PR sanitizer/59415
> 	* vtable-verify.c (verify_bb_vtables): Check the return value
> 	of gimple_call_fn.
> testsuite/
> 	* g++.dg/ubsan/pr59415.C: New test.
> 
> --- gcc/vtable-verify.c.mp	2013-12-09 13:11:24.045759854 +0100
> +++ gcc/vtable-verify.c	2013-12-09 14:47:55.549415078 +0100
> @@ -589,7 +589,7 @@ verify_bb_vtables (basic_block bb)
>        if (gimple_code (stmt) == GIMPLE_CALL)

While you are at this, can you please change the above into
      if (is_gimple_call (stmt))
, please?  Thanks.

	Jakub


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