comparison graal/com.oracle.truffle.api/src/com/oracle/truffle/api/instrument/impl/DefaultVisualizer.java @ 21572:d6d7e51d9206

Truffle/instrumentation: catch a NPE error condition (when a tagged STATEMENT has no source information)
author Michael Van De Vanter <michael.van.de.vanter@oracle.com>
date Wed, 27 May 2015 20:49:09 -0700
parents ef30b2318658
children 894f82515e38
comparison
equal deleted inserted replaced
21571:189d7a64b4d9 21572:d6d7e51d9206
50 boolean estimated = false; 50 boolean estimated = false;
51 if (section == null) { 51 if (section == null) {
52 section = node.getEncapsulatingSourceSection(); 52 section = node.getEncapsulatingSourceSection();
53 estimated = true; 53 estimated = true;
54 } 54 }
55 if (section == null) {
56 return "<error: source location>";
57 }
55 return section.getShortDescription() + (estimated ? "~" : ""); 58 return section.getShortDescription() + (estimated ? "~" : "");
56 } 59 }
57 60
58 public String displayMethodName(Node node) { 61 public String displayMethodName(Node node) {
59 if (node == null) { 62 if (node == null) {