Files
clang-p2996/clang/test/Analysis/null-deref-path-notes.c
Artem Dergachev d85a994ca6 [analyzer] Fix an outdated comment in a test. NFC.
llvm-svn: 314298
2017-09-27 10:59:06 +00:00

10 lines
472 B
C

// RUN: %clang_analyze_cc1 -w -x c -analyzer-checker=core -analyzer-output=text -verify %s
// Avoid the crash when finding the expression for tracking the origins
// of the null pointer for path notes.
void pr34373() {
int *a = 0; // expected-note{{'a' initialized to a null pointer value}}
(a + 0)[0]; // expected-warning{{Array access results in a null pointer dereference}}
// expected-note@-1{{Array access results in a null pointer dereference}}
}