================ @@ -348,12 +357,27 @@ void StackAddrEscapeChecker::checkEndFunction(const ReturnStmt *RS, ExplodedNode *Node = Ctx.getPredecessor(); + bool ExitingTopFrame = + Ctx.getPredecessor()->getLocationContext()->inTopFrame(); + + if (ExitingTopFrame && Node->getLocation().getTag() && + Node->getLocation().getTag()->getTagDescription() == ---------------- steakhal wrote:
Yea, it's not pretty. However, the string comparison only happens if we are leaving the top-level entry point, which happens once per entry point, so performance shouldn't be an issue here. Factoring out the clean node construction from the ExprEngine seems like a tangential effort with limited benefits. I'd say let's keep it as-is. What we should make sure though, is to have a test for this branch of code. That would guard the condition to never get stale. I think we already have tests for this purpose. https://github.com/llvm/llvm-project/pull/105648 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits