Ericsson / clang

Cross Translation Unit analysis capability for Clang Static Analyzer. (Fork of official clang at http://llvm.org/git/clang)
http://clang.llvm.org/
Other
15 stars 10 forks source link

NoStoreFuncVisitor fix for function without source range #684

Closed balazske closed 5 years ago

balazske commented 5 years ago

The called decl may be a function that has no source range (the function is called without existing definition or declaration, this is possible in C89).

balazske commented 5 years ago

Trying to create a test but it looks more complicated to do.

balazske commented 5 years ago

There are a lot of changes in BugReporterVisitors.cpp that are missing from the Ericsson version. This particular problem is fixed in https://reviews.llvm.org/rC357329 in a better way, probably that should be back-ported. But what about the other changes (these are relatively old changes, probably still not in clang8?)? In a later change https://reviews.llvm.org/rC357810 the whole line with the "problematic" code is removed.

martong commented 5 years ago

That is a good catch. Unfortunately, there may be fixes which are not in Clang8. Clang8 branch started at 2019.01.16.

I think right now we can leave in your fix, that seems to almost the same what they did in rC357329. And once we change to Clang9 then the later changes will come in.