Szelethus added a comment.

> I am not sure what would be the best way to test this change here.

I'll admit, I'm a bit out of touch with Clang and will unfortunately be for a 
while, but the short answer is that the unit tests we have for the CFG are 
kinda bad. The constructed CFG has a longer lifetime than the AST its based on 
(see: D63538 <https://reviews.llvm.org/D63538>), so we would need to rewrite 
the `BuildCFG()` function that creates it. I have some memories digging into it 
but always got distracted :)

Until then, could you please include the crash you mentioned through a regular 
lit test?



================
Comment at: clang/lib/Analysis/CFG.cpp:5925-5926
 
   // Only ObjCForCollectionStmt is known not to be a non-Expr terminator, hence
   // the cast<>.
   return cast<Expr>(Cond)->IgnoreParens();
----------------
I guess its time to update and/or move this comment a few lines up, maybe even 
add a descriptive assert.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D71791



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

Reply via email to