mirror of
https://github.com/i-net-software/JWebAssembly.git
synced 2025-03-25 07:27:52 +01:00
Fix missing END of TRY CATCH with RETURN in CATCH block.
This commit is contained in:
parent
abb6c8a38a
commit
09a9e66e42
@ -25,6 +25,7 @@ import java.util.List;
|
|||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
|
|
||||||
|
import de.inetsoftware.classparser.Code;
|
||||||
import de.inetsoftware.classparser.CodeInputStream;
|
import de.inetsoftware.classparser.CodeInputStream;
|
||||||
import de.inetsoftware.classparser.TryCatchFinally;
|
import de.inetsoftware.classparser.TryCatchFinally;
|
||||||
import de.inetsoftware.jwebassembly.WasmException;
|
import de.inetsoftware.jwebassembly.WasmException;
|
||||||
@ -61,11 +62,16 @@ class BranchManger {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Remove all branch information for reusing the manager.
|
* Remove all branch information for reusing the manager.
|
||||||
|
*
|
||||||
|
* @param code
|
||||||
|
* the Java method code
|
||||||
*/
|
*/
|
||||||
void reset( TryCatchFinally[] exceptionTable ) {
|
void reset( @Nonnull Code code ) {
|
||||||
allParsedOperations.clear();
|
allParsedOperations.clear();
|
||||||
root.clear();
|
root.clear();
|
||||||
loops.clear();
|
loops.clear();
|
||||||
|
root.endPos = code.getCodeSize();
|
||||||
|
TryCatchFinally[] exceptionTable = code.getExceptionTable();
|
||||||
for( TryCatchFinally ex : exceptionTable ) {
|
for( TryCatchFinally ex : exceptionTable ) {
|
||||||
allParsedOperations.add( new TryCatchParsedBlock( ex ) );
|
allParsedOperations.add( new TryCatchParsedBlock( ex ) );
|
||||||
}
|
}
|
||||||
@ -753,7 +759,7 @@ class BranchManger {
|
|||||||
|
|
||||||
private final int startPos;
|
private final int startPos;
|
||||||
|
|
||||||
private final int endPos;
|
private int endPos;
|
||||||
|
|
||||||
private final WasmBlockOperator startOp;
|
private final WasmBlockOperator startOp;
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@ class JavaMethodWasmCodeBuilder extends WasmCodeBuilder {
|
|||||||
CodeInputStream byteCode = null;
|
CodeInputStream byteCode = null;
|
||||||
try {
|
try {
|
||||||
reset();
|
reset();
|
||||||
branchManager.reset( code.getExceptionTable() );
|
branchManager.reset( code );
|
||||||
|
|
||||||
byteCode = code.getByteCode();
|
byteCode = code.getByteCode();
|
||||||
writeCode( byteCode, code.getConstantPool(), hasReturn );
|
writeCode( byteCode, code.getConstantPool(), hasReturn );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user