diff --git a/substratevm/src/com.oracle.graal.pointsto/src/com/oracle/graal/pointsto/results/StrengthenGraphs.java b/substratevm/src/com.oracle.graal.pointsto/src/com/oracle/graal/pointsto/results/StrengthenGraphs.java index 8204306cb557..61c10002bfee 100644 --- a/substratevm/src/com.oracle.graal.pointsto/src/com/oracle/graal/pointsto/results/StrengthenGraphs.java +++ b/substratevm/src/com.oracle.graal.pointsto/src/com/oracle/graal/pointsto/results/StrengthenGraphs.java @@ -589,8 +589,11 @@ private void handleInvoke(Invoke invoke, SimplifierTool tool) { Collection callees = invokeFlow.getOriginalCallees(); if (callees.isEmpty()) { - unreachableInvoke(invoke, tool); - /* Invoke is unreachable, there is no point in improving any types further. */ + if (isClosedTypeWorld) { + /* Invoke is unreachable, there is no point in improving any types further. */ + unreachableInvoke(invoke, tool); + } + /* In open world we cannot make any assumptions about an invoke with 0 callees. */ return; } assert invokeFlow.isFlowEnabled() : "Disabled invoke should have no callees: " + invokeFlow + ", in method " + getQualifiedName(graph);