mirror of
https://github.com/i-net-software/JWebAssembly.git
synced 2025-03-15 02:44:47 +01:00
prevent empty ELSE branches
This commit is contained in:
parent
2f8538dbf5
commit
4b2b65e883
@ -563,8 +563,13 @@ class BranchManager {
|
||||
endPos = branch.endPos;
|
||||
} else {
|
||||
branch.elseEndPos = endPos;
|
||||
branch = new BranchNode( positions.elsePos, endPos, WasmBlockOperator.ELSE, WasmBlockOperator.END );
|
||||
parent.add( branch );
|
||||
if( positions.elsePos == endPos ) {
|
||||
// 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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user