Skip to content

Commit 2e6bef7

Browse files
committed
[GR-62290] Fix concurrency issue with base layer graphs
PullRequest: graal/20065
2 parents 9ab82d5 + 0e69070 commit 2e6bef7

File tree

1 file changed

+5
-1
lines changed
  • substratevm/src/com.oracle.graal.pointsto/src/com/oracle/graal/pointsto/meta

1 file changed

+5
-1
lines changed

substratevm/src/com.oracle.graal.pointsto/src/com/oracle/graal/pointsto/meta/AnalysisMethod.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1048,7 +1048,11 @@ public String toString() {
10481048
static GraphCacheEntry createLockEntry(Stage stage, GraphCacheEntry base, ReentrantLock lock) {
10491049
return switch (stage) {
10501050
case BYTECODE_PARSED -> new GraphCacheEntry(lock, lock);
1051-
case OPTIMIZATIONS_APPLIED -> new GraphCacheEntry(base.bytecodeParsedObject, lock);
1051+
/*
1052+
* If the stage 1 is skipped, the first stage needs to be locked too, to avoid
1053+
* another thread stealing the unparsed state.
1054+
*/
1055+
case OPTIMIZATIONS_APPLIED -> base.bytecodeParsedObject == GRAPH_CACHE_UNPARSED ? new GraphCacheEntry(lock, lock) : new GraphCacheEntry(base.bytecodeParsedObject, lock);
10521056
};
10531057
}
10541058

0 commit comments

Comments
 (0)