mirror of
https://github.com/i-net-software/JWebAssembly.git
synced 2025-03-15 02:44:47 +01:00
Detect more block overlapping for IF instructions.
This commit is contained in:
parent
28cc29a30a
commit
e512ee4e65
@ -609,7 +609,19 @@ class BranchManager {
|
||||
return;
|
||||
}
|
||||
|
||||
if( parent.overlapped( startPos ) ) {
|
||||
boolean overlapp = parent.overlapped( startPos );
|
||||
if( !overlapp ) {
|
||||
ArrayList<BreakBlock> breakOperations = this.breakOperations;
|
||||
for( int i = breakOperations.size() - 1; i >= 0; i-- ) {
|
||||
BreakBlock breakBlock = breakOperations.get( i );
|
||||
int ep = breakBlock.endPosition;
|
||||
if( startPos < ep && ep < endPos && breakBlock.breakPos < startPos ) {
|
||||
overlapp = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if( overlapp ) {
|
||||
branch = addMiddleNode( parent, parent.startPos, endPos );
|
||||
} else {
|
||||
branch = new BranchNode( startPos, endPos, WasmBlockOperator.BLOCK, WasmBlockOperator.END, conditionType );
|
||||
@ -1353,7 +1365,7 @@ class BranchManager {
|
||||
break;
|
||||
}
|
||||
node = node.parent;
|
||||
} while( node != catchNode );
|
||||
} while( true );
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1760,7 +1772,7 @@ class BranchManager {
|
||||
this.startOp = startOp;
|
||||
this.endOp = endOp;
|
||||
this.data = data;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
|
Loading…
x
Reference in New Issue
Block a user