mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-03-19 00:01:21 +08:00
ASAN: do not unpoison in OpenMP context
gcc/ChangeLog: PR sanitizer/99877 * gimplify.c (gimplify_expr): Right now, we unpoison all variables before a goto <dest>. We should not do it if we are in a omp context. gcc/testsuite/ChangeLog: PR sanitizer/99877 * g++.dg/asan/pr99877.C: New test.
This commit is contained in:
parent
91dd7954c4
commit
598359f627
@ -14328,7 +14328,8 @@ gimplify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p,
|
||||
Doing so would prevent us from reporting a false positives. */
|
||||
if (asan_poisoned_variables
|
||||
&& asan_used_labels != NULL
|
||||
&& asan_used_labels->contains (label))
|
||||
&& asan_used_labels->contains (label)
|
||||
&& !gimplify_omp_ctxp)
|
||||
asan_poison_variables (asan_poisoned_variables, false, pre_p);
|
||||
break;
|
||||
|
||||
|
19
gcc/testsuite/g++.dg/asan/pr99877.C
Normal file
19
gcc/testsuite/g++.dg/asan/pr99877.C
Normal file
@ -0,0 +1,19 @@
|
||||
/* PR sanitizer/99877*/
|
||||
/* { dg-options "-fsanitize=address -fopenmp -O2" } */
|
||||
|
||||
struct vector
|
||||
{
|
||||
int size ();
|
||||
};
|
||||
int
|
||||
main ()
|
||||
{
|
||||
vector outqueue;
|
||||
#pragma omp parallel
|
||||
{
|
||||
goto continueloop;
|
||||
continueloop:;
|
||||
}
|
||||
for (; outqueue.size ();)
|
||||
;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user