For loop with try finally statement using -O3 or -O4 causes SIGSEGV
Original Reporter info from Mantis: olly
-
Reporter name: olly
Original Reporter info from Mantis: olly
- Reporter name: olly
Description:
The following happens on 3.2.0 and trunk (3.3.1).
This causes a SIGSEGV:
var
i: Int32;
begin
for i := 0 to 10 do
try
writeln(i);
finally // SIGSEGV when finally is entered?
end;
end.
This however works:
var
i: Int32;
begin
for i := 0 to 10 do
begin // added begin block
try
writeln(i);
finally // works fine
end;
end;
end.
However this doesn't work and FPC actually raises an error: "Compilation raised exception internally."
var
i, j: Int32;
begin
for i := 0 to 1 do // FPC raises error here
begin
try
j := i;
finally
end;
end;
end.
Thanks.
Mantis conversion info:
- Mantis ID: 37305
- Version: 3.3.1
- Fixed in version: 3.3.1
- Fixed in revision: 48972 (#2b47425f)
- Monitored by: » @zeljan1 (Zeljan Rikalo), » @MageSlayer (Denis Golovan)