mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2026-01-13 12:01:49 +01:00
19 lines
384 B
ObjectPascal
19 lines
384 B
ObjectPascal
{ Source provided for Free Pascal Bug Report 4152 }
|
|
{ Submitted by "C Western" on 2005-07-03 }
|
|
{ e-mail: mftq75@dsl.pipex.com }
|
|
{$R+}{$Q+}
|
|
var
|
|
p:^Byte;
|
|
c:Byte;
|
|
d:Integer;
|
|
v : cardinal;
|
|
begin
|
|
v:=100;
|
|
inc(v,-1);
|
|
p:=@c;
|
|
Inc(p,-1); // Gives compile time error: range check error while evaluating constants
|
|
d:=2;
|
|
Inc(d,-1);
|
|
Inc(p,d); // This fails at run time
|
|
end.
|