mirror of
https://github.com/i-net-software/JWebAssembly.git
synced 2025-03-25 07:27:52 +01:00
prevent empty ELSE branches
This commit is contained in:
parent
2f8538dbf5
commit
4b2b65e883
@ -563,8 +563,13 @@ class BranchManager {
|
|||||||
endPos = branch.endPos;
|
endPos = branch.endPos;
|
||||||
} else {
|
} else {
|
||||||
branch.elseEndPos = endPos;
|
branch.elseEndPos = endPos;
|
||||||
branch = new BranchNode( positions.elsePos, endPos, WasmBlockOperator.ELSE, WasmBlockOperator.END );
|
if( positions.elsePos == endPos ) {
|
||||||
parent.add( branch );
|
// we does not need an empty else branch
|
||||||
|
branch.endOp = WasmBlockOperator.END;
|
||||||
|
} else {
|
||||||
|
branch = new BranchNode( positions.elsePos, endPos, WasmBlockOperator.ELSE, WasmBlockOperator.END );
|
||||||
|
parent.add( branch );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user