================
@@ -398,7 +400,7 @@ void StackAddrEscapeChecker::checkEndFunction(const 
ReturnStmt *RS,
     }(Referrer->getMemorySpace());
 
     // This cast supposed to succeed.
----------------
DonatNagyE wrote:

I think the best would be either a comment that explains _why_ we expect a 
`VarRegion` here (e.g. it's already checked in function `fooBar()` etc.) or if 
possible, then a crash-less logic (converting an earlier `isa`-like check + 
this `cast` into a single `getAs`).

I don't think that we should add defensive/paranoid checks; if this logic is 
broken by some change in the distant future, then a fixable crash is better 
than silent degradation. 

https://github.com/llvm/llvm-project/pull/66493
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to