Any use whatsoever of "label" and "goto" in a procedure marked as inline crashes the compiler.
Original Reporter info from Mantis: Akira1364
-
Reporter name:
Original Reporter info from Mantis: Akira1364
- Reporter name:
Description:
I'm aware that inline would not be supported (AFAIK) for methods containing gotos in the first place, however, that's a different thing than hard-crashing the compiler (with no real error message).
Steps to reproduce:
Attempt to compile the following example program:
program BugExample;
{$mode ObjFPC}
{$GOTO ON}
type SubRange = 1..3;
procedure Blah(const I: SubRange); inline;
var
B: Boolean = True;
label
Top;
begin
Top:
case I of
1:
WriteLn(2);
2:
if B then
begin
B := False;
WriteLn('Resetting!');
goto Top;
end
else
WriteLn(4);
3:
WriteLn(6);
end;
end;
procedure DoIt;
begin
Blah(1);
Blah(2);
Blah(3);
end;
begin
DoIt;
end.
Note that if "inline" is removed, it compiles without issues and runs as expected.
Mantis conversion info:
- Mantis ID: 35820
- OS: Windows
- OS Build: 10
- Build: Trunk
- Platform: x86_64
- Version: 3.3.1
- Fixed in version: 3.3.1
- Fixed in revision: 43793 (#fd0012de)
- Monitored by: » Akira1364 (Akira1364), » @MageSlayer (Denis Golovan)