Fix memory leaks - batch 2 (#6417)

This commit is contained in:
Geza Lore
2025-09-10 22:42:45 +01:00
committed by GitHub
parent 57d8bb5d1f
commit f1396fbced
13 changed files with 188 additions and 156 deletions
+1
View File
@@ -125,6 +125,7 @@ class DfgRegularize final {
// If it's an inlined expression, repalce the VarRef entirely
if (AstNodeExpr* const newp = VN_CAST(replacementp, NodeExpr)) {
refp->replaceWith(newp->cloneTreePure(false));
VL_DO_DANGLING(refp->deleteTree(), refp);
return;
}
// Otherwise just re-point the VarRef to the new variable