From 5bac2fd5c95466a3c9a70ad2eb609046575eded9 Mon Sep 17 00:00:00 2001 From: Denis Zharkov Date: Fri, 10 Jun 2016 18:40:41 +0300 Subject: [PATCH] Make mutable continuation fields volatile --- .../jetbrains/kotlin/codegen/coroutines/CoroutineCodegen.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/coroutines/CoroutineCodegen.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/coroutines/CoroutineCodegen.kt index 94e399de7fd..f248d1ed8e9 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/coroutines/CoroutineCodegen.kt +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/coroutines/CoroutineCodegen.kt @@ -55,12 +55,12 @@ class CoroutineCodegen( override fun generateClosureBody() { v.newField( - JvmDeclarationOrigin.NO_ORIGIN, Opcodes.ACC_PRIVATE, + JvmDeclarationOrigin.NO_ORIGIN, Opcodes.ACC_PRIVATE or Opcodes.ACC_VOLATILE, COROUTINE_CONTROLLER_FIELD_NAME, typeMapper.mapType(controllerType).descriptor, null, null) v.newField( - JvmDeclarationOrigin.NO_ORIGIN, Opcodes.ACC_PRIVATE, + JvmDeclarationOrigin.NO_ORIGIN, Opcodes.ACC_PRIVATE or Opcodes.ACC_VOLATILE, COROUTINE_LABEL_FIELD_NAME, Type.INT_TYPE.descriptor, null, null)