mirror of
https://github.com/i-net-software/JWebAssembly.git
synced 2025-03-15 10:44:47 +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 de.inetsoftware.classparser.Code;
|
||||
import de.inetsoftware.classparser.CodeInputStream;
|
||||
import de.inetsoftware.classparser.TryCatchFinally;
|
||||
import de.inetsoftware.jwebassembly.WasmException;
|
||||
@ -61,11 +62,16 @@ class BranchManger {
|
||||
|
||||
/**
|
||||
* 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();
|
||||
root.clear();
|
||||
loops.clear();
|
||||
root.endPos = code.getCodeSize();
|
||||
TryCatchFinally[] exceptionTable = code.getExceptionTable();
|
||||
for( TryCatchFinally ex : exceptionTable ) {
|
||||
allParsedOperations.add( new TryCatchParsedBlock( ex ) );
|
||||
}
|
||||
@ -753,7 +759,7 @@ class BranchManger {
|
||||
|
||||
private final int startPos;
|
||||
|
||||
private final int endPos;
|
||||
private int endPos;
|
||||
|
||||
private final WasmBlockOperator startOp;
|
||||
|
||||
|
@ -56,7 +56,7 @@ class JavaMethodWasmCodeBuilder extends WasmCodeBuilder {
|
||||
CodeInputStream byteCode = null;
|
||||
try {
|
||||
reset();
|
||||
branchManager.reset( code.getExceptionTable() );
|
||||
branchManager.reset( code );
|
||||
|
||||
byteCode = code.getByteCode();
|
||||
writeCode( byteCode, code.getConstantPool(), hasReturn );
|
||||
|
Loading…
x
Reference in New Issue
Block a user