[static analyzer] Analyzer is skipping forward declared C/C++ functions
A patch by Karthik Bhat! This patch fixes a regression introduced by r224398. Prior to r224398 we were able to analyze the following code in test-include.c and report a null deref in this case. But post r224398 this analysis is being skipped. E.g. // test-include.c #include "test-include.h" void test(int * data) { data = 0; *data = 1; } // test-include.h void test(int * data); This patch uses the function body (instead of its declaration) as the location of the function when deciding if the Decl should be analyzed with path-sensitive analysis. (Prior to r224398, the call graph was guaranteed to have a definition when available.) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240800 91177308-0d34-0410-b5e6-96231b3b80d8
Showing
- lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp 4 additions, 1 deletionlib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp
- test/Analysis/test-include-cpp.cpp 13 additions, 0 deletionstest/Analysis/test-include-cpp.cpp
- test/Analysis/test-include-cpp.h 9 additions, 0 deletionstest/Analysis/test-include-cpp.h
- test/Analysis/test-include.c 21 additions, 0 deletionstest/Analysis/test-include.c
- test/Analysis/test-include.h 2 additions, 0 deletionstest/Analysis/test-include.h
test/Analysis/test-include-cpp.cpp
0 → 100644
test/Analysis/test-include-cpp.h
0 → 100644
test/Analysis/test-include.c
0 → 100644
test/Analysis/test-include.h
0 → 100644
Please register or sign in to comment