File tree Expand file tree Collapse file tree 1 file changed +3
-0
lines changed Expand file tree Collapse file tree 1 file changed +3
-0
lines changed Original file line number Diff line number Diff line change 11// RUN: %clang_analyze_cc1 -Wno-array-bounds -analyzer-checker=core,security.ArrayBound,debug.ExprInspection -verify %s
22
33void clang_analyzer_eval (int );
4+ void clang_analyzer_value (int );
45
56// Tests doing an out-of-bounds access after the end of an array using:
67// - constant integer index
@@ -203,6 +204,7 @@ int test_cast_to_unsigned(signed char x) {
203204 // load a negative value from an unsigned variable. This causes an underflow
204205 // report, which is an ugly false positive.
205206 // The underlying issue is tracked by Github ticket #39492.
207+ clang_analyzer_value (y ); // expected-warning {{8s:{ [-128, -1] } }}
206208 return table [y ]; // expected-warning {{Out of bound access to memory preceding}}
207209}
208210
@@ -214,6 +216,7 @@ int test_cast_to_unsigned_overflow(signed char x) {
214216 // an overflow report (because the negative values are cast to `unsigned
215217 // char` values that are too large).
216218 // FIXME: See comment in 'test_cast_to_unsigned'.
219+ clang_analyzer_value (y ); // expected-warning {{8s:{ [-128, -1] } }}
217220 return small_table [y ]; // expected-warning {{Out of bound access to memory preceding}}
218221}
219222
You can’t perform that action at this time.
0 commit comments