Fix VerifyError on android with 'inv' operation on Byte and Short
This commit is contained in:
@@ -19,19 +19,21 @@ package org.jetbrains.kotlin.codegen.intrinsics
|
||||
import org.jetbrains.kotlin.codegen.AsmUtil.numberFunctionOperandType
|
||||
import org.jetbrains.kotlin.codegen.Callable
|
||||
import org.jetbrains.kotlin.codegen.CallableMethod
|
||||
import org.jetbrains.kotlin.codegen.StackValue
|
||||
import org.jetbrains.org.objectweb.asm.Type
|
||||
|
||||
class Inv : IntrinsicMethod() {
|
||||
override fun toCallable(method: CallableMethod): Callable {
|
||||
val type = numberFunctionOperandType(method.returnType)
|
||||
return createUnaryIntrinsicCallable(method, newThisType = type) {
|
||||
val intermediateResultType = numberFunctionOperandType(method.returnType)
|
||||
return createUnaryIntrinsicCallable(method) {
|
||||
if (returnType == Type.LONG_TYPE) {
|
||||
it.lconst(-1)
|
||||
}
|
||||
else {
|
||||
it.iconst(-1)
|
||||
}
|
||||
it.xor(returnType)
|
||||
it.xor(intermediateResultType)
|
||||
StackValue.coerce(intermediateResultType, returnType, it)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user