| commit | 0e75af7c064395c33d353c2b98078bc3b3113c7e | [log] [tgz] |
|---|---|---|
| author | Rico Wind <ricow@google.com> | Mon Aug 19 13:36:01 2019 +0200 |
| committer | Rico Wind <ricow@google.com> | Mon Aug 19 13:36:01 2019 +0200 |
| tree | 4e3062414902a9ce70688f3e56481c30cc62bfb9 | |
| parent | 2cc55169fccc744a6e7fdcc519a1846757ebb927 [diff] |
Synchronize access to getClassInitializer The current version is not thread safe - and we build the call graph in parallel. Change-Id: I5f20a8bfe032f2ce8ee28e25582c0554262923d6
diff --git a/src/main/java/com/android/tools/r8/graph/DexClass.java b/src/main/java/com/android/tools/r8/graph/DexClass.java index 00602a7..6f5df28 100644 --- a/src/main/java/com/android/tools/r8/graph/DexClass.java +++ b/src/main/java/com/android/tools/r8/graph/DexClass.java
@@ -650,7 +650,7 @@ return false; } - public DexEncodedMethod getClassInitializer() { + public synchronized DexEncodedMethod getClassInitializer() { if (cachedClassInitializer == null) { cachedClassInitializer = Optional.empty(); for (DexEncodedMethod directMethod : directMethods) {