diff --git a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/llvm/IrToBitcode.kt b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/llvm/IrToBitcode.kt index 865a49f17a6..662d3ef08c8 100644 --- a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/llvm/IrToBitcode.kt +++ b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/llvm/IrToBitcode.kt @@ -1884,6 +1884,7 @@ internal class CodeGeneratorVisitor(val context: Context) : IrElementVisitorVoid fun callVirtual(descriptor: FunctionDescriptor, args: List, resultLifetime: Lifetime): LLVMValueRef { + assert(LLVMTypeOf(args[0]) == codegen.kObjHeaderPtr) val typeInfoPtrPtr = LLVMBuildStructGEP(codegen.builder, args[0], 0 /* type_info */, "")!! val typeInfoPtr = codegen.load(typeInfoPtrPtr) assert (typeInfoPtr.type == codegen.kTypeInfoPtr)