Skip to content

Commit 45c4d79

Browse files
author
Philippe Gil
committed
Fix crash dumping memory statistics on windows
When PIE mode is used address reported doesn't fit in Long_Integer type used to handle conversions. Long_Integer replaced it by valid & portable System.Storage_Elements.Integer_Address for #1142
1 parent 742d952 commit 45c4d79

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

source/memory/lsp-memory_statistics.adb

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,11 @@ package body LSP.Memory_Statistics is
6666
declare
6767
Traceback_Str : constant String :=
6868
S (Matched (1).First .. Matched (1).Last);
69-
Traceback_Long : constant Long_Integer :=
70-
Long_Integer'Value
69+
Traceback_Long : constant Integer_Address :=
70+
Integer_Address'Value
7171
("16#" & Traceback_Str & "#");
7272
Traceback_Addr : constant System.Address :=
73-
To_Address
74-
(Integer_Address (Traceback_Long));
73+
To_Address (Traceback_Long);
7574
New_S : constant String :=
7675
Symbolic_Traceback_No_Hex
7776
((1 => Traceback_Addr));

0 commit comments

Comments
 (0)