================
@@ -454,6 +462,17 @@ void FactsGenerator::handleLifetimeEnds(const 
CFGLifetimeEnds &LifetimeEnds) {
             BL->getID(), LifetimeEnds.getTriggerStmt()->getEndLoc()));
     }
   }
+  // In loops, the back-edge can make a dead origin appear live at its
+  // pointee's ExpireFact. Expiring the origin here prevents that.
+  if (OriginList *List = getOriginsList(*LifetimeEndsVD)) {
+    for (OriginList *L = List; L; L = L->peelOuterOrigin()) {
----------------
usx95 wrote:

I think the confusion might be stemming from the incapability of the analysis 
not being able to associate 7 and 2 here. 

In principle, from language perspective, 2 and 7 should not be different and 
effecting should effect the other. These are essentially aliases to each other 
until `pp` is redefined to point to something else. Currently the analysis 
cannot model this flow-sensitive aliased origins and we observe this as a 
fallout.

I would also recommend to not clear these inner origins to better reflect the 
intention.

https://github.com/llvm/llvm-project/pull/182368
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to