c++: fix -fsanitize-coverage=trace-pc ICE [PR101331]
PR c++/101331 gcc/ChangeLog: * asan.h (sanitize_coverage_p): Handle when fn == NULL. gcc/testsuite/ChangeLog: * g++.dg/pr101331.C: New test.
This commit is contained in:
parent
a7f59856ea
commit
90ac6edc3c
@ -255,8 +255,9 @@ static inline bool
|
||||
sanitize_coverage_p (const_tree fn = current_function_decl)
|
||||
{
|
||||
return (flag_sanitize_coverage
|
||||
&& lookup_attribute ("no_sanitize_coverage",
|
||||
DECL_ATTRIBUTES (fn)) == NULL_TREE);
|
||||
&& (fn == NULL_TREE
|
||||
|| lookup_attribute ("no_sanitize_coverage",
|
||||
DECL_ATTRIBUTES (fn)) == NULL_TREE));
|
||||
}
|
||||
|
||||
#endif /* TREE_ASAN */
|
||||
|
7
gcc/testsuite/g++.dg/pr101331.C
Normal file
7
gcc/testsuite/g++.dg/pr101331.C
Normal file
@ -0,0 +1,7 @@
|
||||
// PR c++/101331
|
||||
// { dg-do compile }
|
||||
// { dg-options "-fsanitize-coverage=trace-pc -O2 -std=c++11" }
|
||||
|
||||
int a[2];
|
||||
int b = 1;
|
||||
int c { b && (a[b] = 0) };
|
Loading…
Reference in New Issue
Block a user