Skip to content

Commit 32bc3f4

Browse files
AnthonyLeonardoGraciosetton
authored andcommitted
VA06-024: Compare SLOCs to workaround a bug in LAL
1 parent d3cb0ca commit 32bc3f4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

source/ada/lsp-ada_contexts.adb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,9 +335,11 @@ package body LSP.Ada_Contexts is
335335
end if;
336336

337337
declare
338+
use VSS.Strings;
338339
Lal_Result : constant Basic_Decl_Array :=
339340
Decl.P_Base_Subp_Declarations;
340-
Our_Result : Basic_Decl_Array (1 .. Lal_Result'Length - 1);
341+
Our_Result : Basic_Decl_Array
342+
(Lal_Result'First .. Lal_Result'Last - 1);
341343
Index : Positive := 1;
342344
begin
343345
-- Libadalang returns an empty array if this is not a subprogram
@@ -349,7 +351,7 @@ package body LSP.Ada_Contexts is
349351
-- The result returned by Libadalang includes self; we want to remove
350352
-- this from the list.
351353
for J of Lal_Result loop
352-
if J /= Decl then
354+
if Node_Location_Image (J) /= Node_Location_Image (Decl) then
353355
Our_Result (Index) := J;
354356
Index := Index + 1;
355357
end if;

0 commit comments

Comments
 (0)