Make fields representing variables in coroutines non-volatile

#KT-14636 Fixed
This commit is contained in:
Denis Zharkov
2016-11-08 11:21:08 +03:00
parent 7e49db8768
commit e54b466010
5 changed files with 60 additions and 2 deletions
@@ -140,8 +140,10 @@ abstract class AbstractBytecodeListingTest : CodegenTestCase() {
override fun visitField(access: Int, name: String, desc: String, signature: String?, value: Any?): FieldVisitor? {
val type = Type.getType(desc).className
declarationsInsideClass.add(Declaration("field $name: $type"))
val fieldDeclaration = Declaration("field $name: $type")
declarationsInsideClass.add(fieldDeclaration)
handleModifiers(access)
if (access and ACC_VOLATILE != 0) addModifier("volatile", fieldDeclaration.annotations)
return object : FieldVisitor(ASM5) {
override fun visitAnnotation(desc: String, visible: Boolean): AnnotationVisitor? {