aboutsummaryrefslogtreecommitdiff
path: root/gcc/asan.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/asan.c')
-rw-r--r--gcc/asan.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/gcc/asan.c b/gcc/asan.c
index 4f882b5..76f21bd 100644
--- a/gcc/asan.c
+++ b/gcc/asan.c
@@ -2750,21 +2750,25 @@ pass_sanopt::execute (function *fun)
FOR_EACH_BB_FN (bb, fun)
{
gimple_stmt_iterator gsi;
- for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
+ for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); )
{
gimple stmt = gsi_stmt (gsi);
+ bool no_next = false;
if (!is_gimple_call (stmt))
- continue;
+ {
+ gsi_next (&gsi);
+ continue;
+ }
if (gimple_call_internal_p (stmt))
switch (gimple_call_internal_fn (stmt))
{
case IFN_UBSAN_NULL:
- ubsan_expand_null_ifn (gsi);
+ no_next = ubsan_expand_null_ifn (&gsi);
break;
case IFN_UBSAN_BOUNDS:
- ubsan_expand_bounds_ifn (&gsi);
+ no_next = ubsan_expand_bounds_ifn (&gsi);
break;
default:
break;
@@ -2777,9 +2781,8 @@ pass_sanopt::execute (function *fun)
fprintf (dump_file, "\n");
}
- /* ubsan_expand_bounds_ifn might move us to the end of the BB. */
- if (gsi_end_p (gsi))
- break;
+ if (!no_next)
+ gsi_next (&gsi);
}
}
return 0;