-- Shows reuse of a stack value by an uninitialized variable
with Text_IO; use Text_IO;
with System.Address_Image;
procedure aliasedLocal2b is

    procedure A is
        ai: Integer;   -- Unitialized
    begin
        put_line("ai and Address of ai: " & ai'img & ": "
                  & System.Address_Image(ai'address));
    end a; 

    procedure B is
        bi: Integer := 99;
    begin
        put_line("bi and Address of bi: " & bi'img & ": "
                  & System.Address_Image(bi'address));
        A;
    end b; 

    i: Integer;      -- Address of i: BF98044C
    j: Integer;      -- Address of j: BF980448

begin
    put_line("Address of i: " & System.Address_Image(i'address));
    put_line("Address of j: " & System.Address_Image(j'address));

    A;               -- ai and Address of ai: -1080556592: BF980380

    B;               -- bi and Address of bi:  99: BF980380
                     -- ai and Address of ai:  134708032: BF9802A0
      
    A;               -- ai and Address of ai:  99: BF980380

end aliasedLocal2b;