[PATCH] D136162: [analyzer] Fix assertion failure in RegionStore within bindArray()

Gabor Marton via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 18 06:40:01 PDT 2022


martong added a comment.

Hmm, seems like the conflicting prototype (i.e. the obsolescent use of zero parameters) is needed to reproduce the assertion failure. That makes me wonder, how does the redecl chain of `b` looks like? Is `void b()` chained with `void b(int*)`, or are they represented independently from each other? I guess they form the same redecl chain. Which drives us to the next questions.
When the analyzer reaches the CallExpr `b(&buffer)` which FunctionDecl does it see? Is it `b()` or `b(int*)`? My bet, it sees and works with `b()`. Could we detect if the arguments of the CallExpr does not match the parameters of the FunctionDecl? And if that is the case, could we iterate through the redecl chain to find an appropriate matching FunctionDecl? That would be `b(int*)` in this case ... and the original `bindArray()` should work then.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D136162/new/

https://reviews.llvm.org/D136162



More information about the cfe-commits mailing list