This reverts commit d50d9946d1d7e5f20881f0bc71fbd025040b1c96. Broke check-clang, see comments on https://reviews.llvm.org/D126067 Also revert dependent change "[analyzer] Deprecate the unused 'analyzer-opt-analyze-nested-blocks' cc1 flag" This reverts commit 07b4a6d0461fe64e10d30029ed3d598e49ca3810. Also revert "[analyzer] Fix buildbots after introducing a new frontend warning" This reverts commit 90374df15ddc58d823ca42326a76f58e748f20eb. (See https://reviews.llvm.org/rG90374df15ddc58d823ca42326a76f58e748f20eb)
23 lines
566 B
C++
23 lines
566 B
C++
// RUN: %clang_analyze_cc1 -analyzer-checker=core,unix,osx,alpha.unix,alpha.security.taint -analyzer-store region -verify %s
|
|
// expected-no-diagnostics
|
|
|
|
class Evil {
|
|
public:
|
|
void system(int); // taint checker
|
|
void malloc(void *); // taint checker, malloc checker
|
|
void free(); // malloc checker, keychain checker
|
|
void fopen(); // stream checker
|
|
void feof(int, int); // stream checker
|
|
void open(); // unix api checker
|
|
};
|
|
|
|
void test(Evil &E) {
|
|
// no warnings, no crashes
|
|
E.system(0);
|
|
E.malloc(0);
|
|
E.free();
|
|
E.fopen();
|
|
E.feof(0,1);
|
|
E.open();
|
|
}
|