steakhal added inline comments.

================
Comment at: clang/lib/StaticAnalyzer/Checkers/ReturnPointerRangeChecker.cpp:48
+          dyn_cast_or_null<CallExpr>(C.getStackFrame()->getCallSite());
+      CE && CE->getBuiltinCallee() != 0)
+    return;
----------------
NoQ wrote:
> I suspect that you might run into more similar problems with functions coming 
> from "body farms". A direct check like
> ```lang=c++
> RetE->getBeginLoc().isValid()
> ```
> might be more reliable.
> 
> You might need to check the entire range though. We probably need a unified 
> solution for such checks, because many checkers end up implementing them.
We were actually considering it. We decided against it to keep the impact of 
this fix minimal.

That being said, I wonder if a similar check should be at some higher level 
API, lets say inside the emitReport.
That way no chevker would experience such crashes. WDYT?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D138713

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to