bug fix for .NET 4.6: exit in except block caused runtime error

This commit is contained in:
Бондарев Иван 2015-07-26 17:18:27 +02:00
parent cce539f4a0
commit 540394db13
2 changed files with 5 additions and 2 deletions

View file

@ -10290,7 +10290,10 @@ namespace PascalABCCompiler.NETGenerator
{
if (!ExitProcedureCall)
ExitLabel = il.DefineLabel();
il.Emit(OpCodes.Br, ExitLabel);
if (!safe_block)
il.Emit(OpCodes.Br, ExitLabel);
else
il.Emit(OpCodes.Leave, ExitLabel);
ExitProcedureCall = true;
}

View file

@ -1964,7 +1964,7 @@ begin
on e: System.Exception do
begin
Result := nil;
Exit;
//Exit;
end;
end;
end;