[PATCH] D81745: [analyzer][MallocChecker] PR46253: Correctly recognize standard realloc

Artem Dergachev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Jun 13 15:29:52 PDT 2020


NoQ accepted this revision.
NoQ added a comment.
This revision is now accepted and ready to land.

Thanks! Yeah, that's a lot of annoying code to write that doesn't need to be imperative at all.



================
Comment at: clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp:1074-1075
+  // function. This should be solved by making CallDescription smarter.
+  // Mind that this came from a bug report, and all other functions suffer from
+  // this.
+  // https://bugs.llvm.org/show_bug.cgi?id=46253
----------------
> https://bugs.llvm.org/show_bug.cgi?id=46253#c1
> Uh-oh, did we lose some sanity checking during CallDescription conversion?

While modeling of all functions is probably incorrect, the //crash// can be bisected down to D68165. I think other functions don't crash because they already have similar type checks in them, just more spread out around the code rather than concentrated in one place. It might still be worth it to try to figure out why exactly did D68165 cause it in order to double-check for more regressions.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D81745





More information about the cfe-commits mailing list