# HG changeset patch # User Christian Humer # Date 1412931251 -7200 # Node ID 4c0dcd16471893bcc201c8c166b26974aa617a83 # Parent f0792f868d7df0b64f7495680aab2fad2ecb0f41 Truffle: fix potential null dereference error in partial evaluator. diff -r f0792f868d7d -r 4c0dcd164718 graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/PartialEvaluator.java --- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/PartialEvaluator.java Thu Oct 09 17:25:35 2014 +0200 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/PartialEvaluator.java Fri Oct 10 10:54:11 2014 +0200 @@ -369,33 +369,26 @@ } TruffleInliningDecision decision = inlining.findByCall(callNode); - boolean inline; if (decision == null) { if (TruffleCompilerOptions.TraceTrufflePerformanceWarnings.getValue()) { Map properties = new LinkedHashMap<>(); properties.put("callNode", callNode); logPerformanceWarning("A direct call within the Truffle AST is not reachable anymore. Call node could not be inlined.", properties); } - inline = false; - } else { - inline = decision.isInline(); } - assert decision.getProfile().getCallNode() == callNode; - - OptimizedCallTarget currentTarget = decision.getProfile().getCallNode().getCurrentCallTarget(); - if (decision.getTarget() != currentTarget) { + if (decision != null && decision.getTarget() != decision.getProfile().getCallNode().getCurrentCallTarget()) { if (TruffleCompilerOptions.TraceTrufflePerformanceWarnings.getValue()) { Map properties = new LinkedHashMap<>(); properties.put("originalTarget", decision.getTarget()); properties.put("callNode", callNode); logPerformanceWarning(String.format("CallTarget changed during compilation. Call node could not be inlined."), properties); } - inline = false; + decision = null; } StructuredGraph graph; - if (inline) { + if (decision != null && decision.isInline()) { if (inliningCache == null) { graph = createInlineGraph(phaseContext, assumptions, null, decision); } else {