Commit fe46e7aa by Marek Polacek Committed by Marek Polacek

re PR sanitizer/59415 (ICE segfault in verify_bb_vtables for g++ -S…

re PR sanitizer/59415 (ICE segfault in verify_bb_vtables for g++ -S -fvtable-verify=std -fsanitize=null)

	PR sanitizer/59415
	* vtable-verify.c (verify_bb_vtables): Check the return value
	of gimple_call_fn.  Use is_gimple_call instead of gimple_code.
testsuite/
	* g++.dg/ubsan/pr59415.C: New test.

From-SVN: r205805
parent 85591a5c
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. Use is_gimple_call instead of gimple_code.
2013-12-09 Kyrylo Tkachov <kyrylo.tkachov@arm.com> 2013-12-09 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
* config/arm/arm.md (generic_sched): Add cortexa12. * config/arm/arm.md (generic_sched): Add cortexa12.
2013-12-09 Marek Polacek <polacek@redhat.com>
PR sanitizer/59415
* g++.dg/ubsan/pr59415.C: New test.
2013-12-09 Paolo Carlini <paolo.carlini@oracle.com> 2013-12-09 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/52707 PR c++/52707
......
/* { dg-do compile } */
/* { dg-options "-fsanitize=null -Wall -fvtable-verify=std" } */
void
foo (void)
{
throw 0;
}
...@@ -586,10 +586,10 @@ verify_bb_vtables (basic_block bb) ...@@ -586,10 +586,10 @@ verify_bb_vtables (basic_block bb)
stmt = gsi_stmt (gsi_virtual_call); stmt = gsi_stmt (gsi_virtual_call);
/* Count virtual calls. */ /* Count virtual calls. */
if (gimple_code (stmt) == GIMPLE_CALL) if (is_gimple_call (stmt))
{ {
tree fncall = gimple_call_fn (stmt); tree fncall = gimple_call_fn (stmt);
if (TREE_CODE (fncall) == OBJ_TYPE_REF) if (fncall && TREE_CODE (fncall) == OBJ_TYPE_REF)
total_num_virtual_calls++; total_num_virtual_calls++;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment