Define the this parameter with the best matching type.

This commit is contained in:
Volker Berlin 2021-05-02 14:08:19 +02:00
parent f97b24a933
commit 631bd4efc3

View File

@ -30,7 +30,6 @@ import de.inetsoftware.classparser.LocalVariableTable;
import de.inetsoftware.classparser.MethodInfo;
import de.inetsoftware.jwebassembly.WasmException;
import de.inetsoftware.jwebassembly.wasm.AnyType;
import de.inetsoftware.jwebassembly.wasm.ValueType;
import de.inetsoftware.jwebassembly.wasm.ValueTypeParser;
/**
@ -163,7 +162,7 @@ class LocaleVariableManager {
if( (maxLocals > 0 || variableTable == null) && size == 0 && (method != null || signature != null )) {
Iterator<AnyType> parser = signature == null ? new ValueTypeParser( method.getType(), types ) : signature;
if( method != null && !method.isStatic() ) {
resetAddVar( ValueType.externref, size );
resetAddVar( types.valueOf( method.getClassName() ), size );
}
while( true ) {
AnyType type = parser.next();