From c6fa14fa163a481831f76f960ea911091c70f8a7 Mon Sep 17 00:00:00 2001 From: Dmitry Khalanskiy Date: Thu, 10 Dec 2020 16:10:51 +0300 Subject: [PATCH] Fix incorrect ProGuard rules that allowed shrinking volatile felds Fixes #1564 --- .../jvm/resources/META-INF/proguard/coroutines.pro | 4 ++-- .../resources/META-INF/proguard/coroutines.pro | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/kotlinx-coroutines-core/jvm/resources/META-INF/proguard/coroutines.pro b/kotlinx-coroutines-core/jvm/resources/META-INF/proguard/coroutines.pro index 60c8d61243..96ffd29e8a 100644 --- a/kotlinx-coroutines-core/jvm/resources/META-INF/proguard/coroutines.pro +++ b/kotlinx-coroutines-core/jvm/resources/META-INF/proguard/coroutines.pro @@ -3,12 +3,12 @@ -keepnames class kotlinx.coroutines.CoroutineExceptionHandler {} # Most of volatile fields are updated with AFU and should not be mangled --keepclassmembernames class kotlinx.** { +-keepclassmembers class kotlinx.** { volatile ; } # Same story for the standard library's SafeContinuation that also uses AtomicReferenceFieldUpdater --keepclassmembernames class kotlin.coroutines.SafeContinuation { +-keepclassmembers class kotlin.coroutines.SafeContinuation { volatile ; } diff --git a/kotlinx-coroutines-test/resources/META-INF/proguard/coroutines.pro b/kotlinx-coroutines-test/resources/META-INF/proguard/coroutines.pro index 41c9eb0722..1decb1cb70 100644 --- a/kotlinx-coroutines-test/resources/META-INF/proguard/coroutines.pro +++ b/kotlinx-coroutines-test/resources/META-INF/proguard/coroutines.pro @@ -4,6 +4,6 @@ -keepnames class kotlinx.coroutines.android.AndroidDispatcherFactory {} # Most of volatile fields are updated with AFU and should not be mangled --keepclassmembernames class kotlinx.** { +-keepclassmembers class kotlinx.** { volatile ; }