Skip to content

Commit 1303cc0

Browse files
committed
Ensure a unique fallback is created for a given method.
1 parent 24f5a78 commit 1303cc0

File tree

1 file changed

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

1 file changed

+6
-1
lines changed

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1128,7 +1128,12 @@ public AnalysisMethod resolveConcreteMethod(ResolvedJavaMethod method, ResolvedJ
11281128
var concreteMethod = originalMethod instanceof BaseLayerMethod ? originalMethod : wrapped.resolveConcreteMethod(originalMethod, originalCallerType);
11291129
newResolvedMethod = universe.lookup(concreteMethod);
11301130
if (newResolvedMethod == null) {
1131-
newResolvedMethod = getUniverse().getBigbang().fallbackResolveConcreteMethod(this, (AnalysisMethod) method);
1131+
/* Ensure we only calculate the fallback method once. */
1132+
resolvedMethod = resolvedMethods.computeIfAbsent(method, (k) -> {
1133+
var fallbackMethod = getUniverse().getBigbang().fallbackResolveConcreteMethod(this, (AnalysisMethod) method);
1134+
return fallbackMethod == null ? NULL_METHOD : fallbackMethod;
1135+
});
1136+
return resolvedMethod == NULL_METHOD ? null : (AnalysisMethod) resolvedMethod;
11321137
}
11331138

11341139
} catch (UnsupportedFeatureException e) {

0 commit comments

Comments
 (0)