Charusso added inline comments.

================
Comment at: clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp:2549-2552
+      FunctionStr = Lexer::getSourceText(
+          CharSourceRange::getTokenRange(
+              {FD->getBeginLoc(), FD->getBody()->getBeginLoc()}),
+          C.getSourceManager(), C.getLangOpts());
----------------
NoQ wrote:
> Charusso wrote:
> > NoQ wrote:
> > > I'm slightly worried that it'll crash when `free()` is being called from 
> > > within a body farm.
> > > 
> > > For now it probably cannot happen because none of the bodyfarmed 
> > > functions can call `free()` directly, but i'd anyway rather add a check 
> > > that the source locations we're taking are valid.
> > Oh, I missed that, thanks! I wanted to check for everything, yes.
> I think this is not fixed yet. I'm thinking of something like `if 
> (!Body->getBeginLoc().isValid()) { ... }`.
Ugh, silly mistake, thanks!


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

https://reviews.llvm.org/D64680



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

Reply via email to