mirror of
https://github.com/i-net-software/JWebAssembly.git
synced 2025-03-25 07:27:52 +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;
|
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 );
|
branch = addMiddleNode( parent, parent.startPos, endPos );
|
||||||
} else {
|
} else {
|
||||||
branch = new BranchNode( startPos, endPos, WasmBlockOperator.BLOCK, WasmBlockOperator.END, conditionType );
|
branch = new BranchNode( startPos, endPos, WasmBlockOperator.BLOCK, WasmBlockOperator.END, conditionType );
|
||||||
@ -1353,7 +1365,7 @@ class BranchManager {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
node = node.parent;
|
node = node.parent;
|
||||||
} while( node != catchNode );
|
} while( true );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1760,7 +1772,7 @@ class BranchManager {
|
|||||||
this.startOp = startOp;
|
this.startOp = startOp;
|
||||||
this.endOp = endOp;
|
this.endOp = endOp;
|
||||||
this.data = data;
|
this.data = data;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user