Skip to content

Commit

Permalink
Fix for null access support in example
Browse files Browse the repository at this point in the history
Fixes null access exceptions for example in advanced Ada / Resource Management / Access Types / Access Type Abstraction example when calling `Copy` (both versions) on an `Info = null`
  • Loading branch information
leogermond authored Jan 16, 2025
1 parent d47dcbf commit 524ad16
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4178,13 +4178,13 @@ Let's see an example:
(if Obj /= null then Obj.all else "");

function Copy (Obj : Info) return Info is
(To_Info (Obj.all));
(To_Info (To_String (Obj)));

procedure Copy (To : in out Info;
From : Info) is
begin
Destroy (To);
To := To_Info (From.all);
To := Copy (From);
end Copy;

procedure Append (Obj : in out Info;
Expand Down

0 comments on commit 524ad16

Please sign in to comment.