Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2009-05

runtime error 216 on nested procedures

2 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Dariusz Mazur

Hi
I have problem with this small program below. I've compiled if on Linux/i386 FPC 2.2.2
Every time of run program halt with runtime. I've test it with short and ansistring. Result the same.
But when I uncomment line with test2 everything goes OK. Is something wrong with program? Can someone test it on newer version FPC?

program testwhile;
{$mode objfpc}{$H+}
function lineHtml( sa : string):string;
var
  xPoz : integer;
  xp,xk  : integer;
  function nextToken(var aPocz: integer;var aKon :integer):string;
  begin
    result:='';
    aPocz:=xPoz+1;
    aKon:=0;
    try
      while xpoz< length(sa) do begin
        inc(xpoz);
        case sa[xpoz] of
         '|' :begin
                 exit;
             end;
        else
        end;
        result:=result+sa[xpoz];
        inc(aKon);
      end;
    finally
      writeln('test ',result);
      aKon:=aPocz+aKon;
//    writeln('test2 ',result);
    end;
  end;
begin
   xpoz:=0;
   result:='';
   repeat
      nextToken(xp,xk);
   until xpoz>=length(sa);
end;
begin
   writeln(lineHTML('|  1 | 2 | 3'));
end.
Darek

Reply by email

Jonas Maebe
to Dariusz Mazur
Dariusz Mazur wrote 7 lines
I have problem with this small program below. I've compiled if on Linux/i386 FPC 2.2.2 Every time of run program halt with runtime. I've test it with short and ansistring. Result the same. But when I uncomment line with test2 everything goes OK. Is something wrong with program? Can someone test it on newer version FPC?

It still happens. It only occurs on i386 and when compiled with -O2. It's due to missing register allocation information. Please open a bug report.

Jonas

Reply by email