mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-14 08:59:28 +02:00
17 lines
295 B
ObjectPascal
17 lines
295 B
ObjectPascal
{ %NORUN }
|
|
|
|
{ Evaluate maliciously-written pure function that contains an infinite loop }
|
|
|
|
{$MODE OBJFPC}
|
|
program tpure7b;
|
|
|
|
function MaliciousPure(Input: Boolean): Cardinal; pure;
|
|
begin
|
|
Result := 0;
|
|
while Input do
|
|
Inc(Result);
|
|
end;
|
|
|
|
begin
|
|
WriteLn(MaliciousPure(True));
|
|
end. |