the dup of this must on the end if there are no more parameters

This commit is contained in:
Volker Berlin 2019-11-26 21:44:49 +01:00
parent d0221065fb
commit 1a89919984

View File

@ -481,7 +481,7 @@ public abstract class WasmCodeBuilder {
}
if( varIndex < 0 ) {
varIndex = getTempVariable( virtualCall.getThisType(), instr.getCodePosition(), javaCodePos + 1 );
idx = findPushInstruction( count - 1, false );
idx = count == 1 ? instructions.size() : findPushInstruction( count - 1, false );
instructions.add( idx, new DupThis( virtualCall, varIndex, javaCodePos ) );
}
virtualCall.setVariableIndexOfThis( varIndex );