Skip to content

Commit

Permalink
Lexical envs: fix inverted logic
Browse files Browse the repository at this point in the history
In exception handlers, we must free resources when it *is* a "legit"
exception taht is raised, and leave them unchanged in other cases. This
fixes a memory leak in the former case.

For #632
  • Loading branch information
pmderodat committed Jul 21, 2022
1 parent 3f9cf09 commit 7d9cbe0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion langkit/support/langkit_support-lexical_envs_impl.adb
Original file line number Diff line number Diff line change
Expand Up @@ -1408,7 +1408,7 @@ package body Langkit_Support.Lexical_Envs_Impl is
-- All bets are off for other kinds of exceptions: just propagate in
-- that case.

if not Properties_May_Raise (Exc) then
if Properties_May_Raise (Exc) then
Local_Results.Destroy;
end if;

Expand Down

0 comments on commit 7d9cbe0

Please sign in to comment.