bug fix #499
This commit is contained in:
parent
0768b5415e
commit
7b5d548c6d
|
|
@ -5655,7 +5655,10 @@ namespace PascalABCCompiler.NETGenerator
|
||||||
public override void visit(IGotoStatementNode value)
|
public override void visit(IGotoStatementNode value)
|
||||||
{
|
{
|
||||||
Label lab = helper.GetLabel(value.label, il);
|
Label lab = helper.GetLabel(value.label, il);
|
||||||
il.Emit(OpCodes.Br, lab);
|
if (safe_block)
|
||||||
|
il.Emit(OpCodes.Leave, lab);
|
||||||
|
else
|
||||||
|
il.Emit(OpCodes.Br, lab);
|
||||||
}
|
}
|
||||||
|
|
||||||
private Stack<Label> if_stack = new Stack<Label>();
|
private Stack<Label> if_stack = new Stack<Label>();
|
||||||
|
|
|
||||||
10
TestSuite/goto1.pas
Normal file
10
TestSuite/goto1.pas
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
label c1;
|
||||||
|
begin
|
||||||
|
var s := 0;
|
||||||
|
foreach var i in range(0, 2) do
|
||||||
|
begin
|
||||||
|
goto c1;
|
||||||
|
s := 2;
|
||||||
|
end;
|
||||||
|
c1: assert(s=0);
|
||||||
|
end.
|
||||||
Loading…
Reference in a new issue