From 96f221d7e23bf7f2533e002b9156298e4745155f Mon Sep 17 00:00:00 2001 From: Thomas Lively Date: Thu, 1 Oct 2026 16:04:32 -0700 Subject: [PATCH] Clear loopTops in CFGWalker CFGWalker clears all its local state when visiting a function, but it previously did not clear loopTops. If CFGWalker were to be used in a non-function-parallel pass, this would lead to dangling BasicBlock pointers in loopTops. There does not happen to be such a use of CFGWalker today, but it is still worth fixing. --- src/cfg/cfg-traversal.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/cfg/cfg-traversal.h b/src/cfg/cfg-traversal.h index 10abd9e4f0a..6cc758e6e2c 100644 --- a/src/cfg/cfg-traversal.h +++ b/src/cfg/cfg-traversal.h @@ -579,6 +579,7 @@ struct CFGWalker : public PostWalker { void doWalkFunction(Function* func) { basicBlocks.clear(); + loopTops.clear(); debugIds.clear(); exit = nullptr; hasSyntheticExit = false;