ada - EXCEPTION_ACCESS_VIOLATION on a static declaration -
i new usage of for ***'address use ***
. , wondering limitation of usage. created following procedure:
procedure letshack (a : system.address) my_string : string(1..100000); my_string'address use a; begin put(my_string); end;
and raise exception_access_violation
while same code string 100 length don't raise it. more on if don't use integer address, code works properly.
so limitation of for ***'address use ***
usage. ps : using ada 95 information welcome.
edit: understand part of behavior. , suppose. when start program stack allocated , can write , read in it. indeed wrote 5th byte integer address
real addresses |----------------------------| virtual addresses 0x48000|stack origine |0x00 | | | | | | | | |end of stack | 0x48000+range|----------------------------|0x00+range
and exception_access_violation if out of stack. seems strange "strong" language if right. because means can rewrite own stack , make bad behave.
if have ensured have allocated 100_000 consecutive characters in readable part of memory starting @ a
, should work.
if a
address of ada entity, not supposed work.
Comments
Post a Comment