mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-08 04:48:07 +02:00
13 lines
572 B
ObjectPascal
13 lines
572 B
ObjectPascal
var
|
|
arr : array[-1..140] of byte=(4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
|
|
4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
|
|
4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4);
|
|
index , value : byte; // unsigned byte - important
|
|
begin
|
|
index:=133; // positive value, which is treated as negative
|
|
value:=arr[index]; // wrong value! Memory access outside array
|
|
if value<>4 then
|
|
halt(1);
|
|
writeln('ok');
|
|
end.
|