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.AsmUtil.numberFunctionOperandType
|
||||||
import org.jetbrains.kotlin.codegen.Callable
|
import org.jetbrains.kotlin.codegen.Callable
|
||||||
import org.jetbrains.kotlin.codegen.CallableMethod
|
import org.jetbrains.kotlin.codegen.CallableMethod
|
||||||
|
import org.jetbrains.kotlin.codegen.StackValue
|
||||||
import org.jetbrains.org.objectweb.asm.Type
|
import org.jetbrains.org.objectweb.asm.Type
|
||||||
|
|
||||||
class Inv : IntrinsicMethod() {
|
class Inv : IntrinsicMethod() {
|
||||||
override fun toCallable(method: CallableMethod): Callable {
|
override fun toCallable(method: CallableMethod): Callable {
|
||||||
val type = numberFunctionOperandType(method.returnType)
|
val intermediateResultType = numberFunctionOperandType(method.returnType)
|
||||||
return createUnaryIntrinsicCallable(method, newThisType = type) {
|
return createUnaryIntrinsicCallable(method) {
|
||||||
if (returnType == Type.LONG_TYPE) {
|
if (returnType == Type.LONG_TYPE) {
|
||||||
it.lconst(-1)
|
it.lconst(-1)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
it.iconst(-1)
|
it.iconst(-1)
|
||||||
}
|
}
|
||||||
it.xor(returnType)
|
it.xor(intermediateResultType)
|
||||||
|
StackValue.coerce(intermediateResultType, returnType, it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user