diff --git a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/llvm/CodeGenerator.kt b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/llvm/CodeGenerator.kt index 5ce7cf81f5a..38414a68682 100644 --- a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/llvm/CodeGenerator.kt +++ b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/llvm/CodeGenerator.kt @@ -673,7 +673,6 @@ internal class FunctionGenerationContext(val function: LLVMValueRef, fun getObjectValue( descriptor: ClassDescriptor, - shared: Boolean, exceptionHandler: ExceptionHandler, locationInfo: LocationInfo? ): LLVMValueRef { @@ -695,6 +694,7 @@ internal class FunctionGenerationContext(val function: LLVMValueRef, } } + val shared = descriptor.symbol.objectIsShared && context.config.threadsAreAllowed val objectPtr = codegen.getObjectInstanceStorage(descriptor, shared) val bbCurrent = currentBlock val bbInit= basicBlock("label_init", locationInfo) 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 7729ca45707..a908aeba806 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 @@ -811,7 +811,6 @@ internal class CodeGeneratorVisitor(val context: Context, val lifetimes: Map