Hi Anna,
This patch fixes a regression introduced by r224398. Prior to r224398 (e.g. in llvm 3.5) 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 as a result we miss many bugs in our codebase.
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 checks if the function declaration has a body in the mainfile currently being analyzed if yes then RunPathSensitiveChecks on the same. This fixes the above issue without any regressions.
Please let me know if you feel this patch looks good to you or if you feel there is a better way to fix the same.
Thanks and Regards
Karthik Bhat
I don't think this if-statement is needed.