mirror of
https://github.com/i-net-software/JWebAssembly.git
synced 2025-03-25 15:37:52 +01:00
improve error handling in the BranchManager
This commit is contained in:
parent
ea2a179161
commit
432168f002
@ -1197,10 +1197,10 @@ class BranchManger {
|
||||
}
|
||||
|
||||
if( startBlock != null && startBlock.getOperation() == WasmBlockOperator.IF ) {
|
||||
try {
|
||||
ArrayDeque<AnyType> stack = new ArrayDeque<>();
|
||||
stack.push( ValueType.empty );
|
||||
INSTRUCTIONS:
|
||||
for( int i = startIdx; i < instructions.size(); i++ ) {
|
||||
INSTRUCTIONS: for( int i = startIdx; i < instructions.size(); i++ ) {
|
||||
WasmInstruction instr = instructions.get( i );
|
||||
int codePos = instr.getCodePosition();
|
||||
if( codePos >= endPos ) {
|
||||
@ -1233,6 +1233,9 @@ class BranchManger {
|
||||
}
|
||||
}
|
||||
startBlock.setData( stack.pop() );
|
||||
} catch( Throwable th ) {
|
||||
throw WasmException.create( th, startBlock.getLineNumber() );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user