Branch: refs/heads/master
Revision: 3869262
Author: e-kayrakli
Log Message:
Merge pull request #17328 from e-kayrakli/close-throwing-forall-leak
Close an EndCount leak in throwing foralls
This PR closes a leak with foralls whose body throw error(s).
@mppf summarized the problem under that issue:
We had defer blocks for the EndCount to make sure it is deleted. But these are
processed (and changed to delete calls at the end of a block) in
callDestructors. Then, lowerIterators lowers the ForallStmt into a more
complex structure and no longer calls the delete if the body of the forall
threw an error. I believe that this is only a problem now that ForallStmts get
lowered later.
With this PR, lowerIterators
now finds any endCountFree
calls that show up
between the error's goto and the associated label, and creates a copy of that
endCountFree
right before the goto.
[Reviewed by @vasslitvinov]
Test Status
-
asan --memLeaks
errhandling/forall
-
quickstart asan
-
standard
-
gasnet
Modified Files:
M compiler/resolution/lowerIterators.cppCompare: Comparing cec4ec0bc748...3869262d8d6e · chapel-lang/chapel · GitHub