mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-07 01:48:00 +02:00
31 lines
350 B
ObjectPascal
31 lines
350 B
ObjectPascal
unit tw39447;
|
|
{$IFDEF FPC}
|
|
{$MODE Delphi}
|
|
{$ENDIF}
|
|
|
|
interface
|
|
uses sysutils;
|
|
|
|
function ptr_twist() : boolean;
|
|
|
|
implementation
|
|
|
|
function ptr_twist() : boolean;
|
|
var
|
|
x : pchar;
|
|
x2 : pchar;
|
|
const
|
|
str : ShortString = '123456789';
|
|
begin
|
|
|
|
x := @(str[2]);
|
|
x := x + 5;
|
|
x2:= 5 + x; // FPC fails here
|
|
|
|
result := (x = x2);
|
|
|
|
end;
|
|
|
|
end.
|
|
|