Detect more block overlapping for IF instructions.

This commit is contained in:
Volker Berlin 2022-07-10 15:55:31 +02:00
parent 28cc29a30a
commit e512ee4e65
No known key found for this signature in database
GPG Key ID: 988423EF815BE4CB

View File

@ -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}