================
@@ -354,6 +368,13 @@ void FactsGenerator::handleAssignment(const Expr *LHSExpr,
// assigned.
RHSList = getRValueOrigins(RHSExpr, RHSList);
+ if (GlobalLHS) {
+ for (OriginList *L = RHSList; L != nullptr; L = L->peelOuterOrigin()) {
+ EscapesInCurrentBlock.push_back(FactMgr.createFact<GlobalEscapeFact>(
+ L->getOuterOriginID(), GlobalLHS));
+ }
+ };
----------------
usx95 wrote:
This looks quite strict. You are essentially disallowing any assignment to a
global pointer. What we would ideally want is ensure at function exit, no
global dangles. This is similar to how we generate escape facts for field decls
in the exit block only.
https://github.com/llvm/llvm-project/pull/181646
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits