This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Don't segv in vtable verification with ubsan (PR sanitizer/59415)
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Marek Polacek <polacek at redhat dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Caroline Tice <cmtice at google dot com>
- Date: Mon, 9 Dec 2013 15:29:38 +0100
- Subject: Re: [PATCH] Don't segv in vtable verification with ubsan (PR sanitizer/59415)
- Authentication-results: sourceware.org; auth=none
- References: <20131209142330 dot GJ11710 at redhat dot com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
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