From 8da502d2edcb8cf770bd38df92fbe4173cd2fcdc Mon Sep 17 00:00:00 2001 From: Pierre-Marie de Rodat Date: Wed, 10 Jul 2024 11:43:09 +0000 Subject: [PATCH 1/2] libadalang-env_hooks.adb: fix coding style issues --- extensions/src/libadalang-env_hooks.adb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/extensions/src/libadalang-env_hooks.adb b/extensions/src/libadalang-env_hooks.adb index 4984ad1eb..7cba77b74 100644 --- a/extensions/src/libadalang-env_hooks.adb +++ b/extensions/src/libadalang-env_hooks.adb @@ -500,6 +500,7 @@ package body Libadalang.Env_Hooks is -- we wanted to return, but if we did that we would not -- have updated the `Referenced_Units` vector to include -- the fact that `From_Unit` references the renamed unit. + if Is_Last then Unit := Unwrap_Unit (Comp_Unit.Unit); end if; @@ -512,11 +513,13 @@ package body Libadalang.Env_Hooks is end; else -- We're on the last portion of the name: return + if Is_Last then return; end if; -- Else, just resolve the next portion of the given name + Step (Name, Index + 1); end if; From 0a78876114849a67f73adc3337a1b72d1506d556 Mon Sep 17 00:00:00 2001 From: Pierre-Marie de Rodat Date: Wed, 10 Jul 2024 11:47:23 +0000 Subject: [PATCH 2/2] libadalang-env_hooks.adb: fix a recently introduced memory leak --- extensions/src/libadalang-env_hooks.adb | 1 + 1 file changed, 1 insertion(+) diff --git a/extensions/src/libadalang-env_hooks.adb b/extensions/src/libadalang-env_hooks.adb index 7cba77b74..7e266a2d4 100644 --- a/extensions/src/libadalang-env_hooks.adb +++ b/extensions/src/libadalang-env_hooks.adb @@ -515,6 +515,7 @@ package body Libadalang.Env_Hooks is -- We're on the last portion of the name: return if Is_Last then + Dec_Ref (Internal_Name); return; end if;