Skip to content
This repository has been archived by the owner on Aug 10, 2021. It is now read-only.

Commit

Permalink
Fix for #1811
Browse files Browse the repository at this point in the history
  • Loading branch information
sbogolepov authored and homuroll committed Aug 8, 2018
1 parent 7a9ba7f commit 9f04c03
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,6 @@ internal class FunctionGenerationContext(val function: LLVMValueRef,

fun getObjectValue(
descriptor: ClassDescriptor,
shared: Boolean,
exceptionHandler: ExceptionHandler,
locationInfo: LocationInfo?
): LLVMValueRef {
Expand All @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -815,7 +815,6 @@ internal class CodeGeneratorVisitor(val context: Context, val lifetimes: Map<IrE
private fun evaluateGetObjectValue(value: IrGetObjectValue): LLVMValueRef =
functionGenerationContext.getObjectValue(
value.symbol.owner,
value.symbol.objectIsShared && context.config.threadsAreAllowed,
currentCodeContext.exceptionHandler,
value.startLocation
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1044,8 +1044,7 @@ private fun ObjCExportCodeGenerator.createObjectInstanceAdapter(

return generateObjCToKotlinSyntheticGetter(selector) {
initRuntimeIfNeeded() // For instance methods it gets called when allocating.

val value = getObjectValue(context.ir.get(descriptor), shared = false, locationInfo = null, exceptionHandler = ExceptionHandler.Caller)
val value = getObjectValue(context.ir.get(descriptor), locationInfo = null, exceptionHandler = ExceptionHandler.Caller)
ret(kotlinToObjC(value, ReferenceBridge))
}
}
Expand Down

0 comments on commit 9f04c03

Please sign in to comment.