changeset 16511:aee02665e505

Truffle: NodeUtil fix for displaying null SourceSections.
author Michael Van De Vanter <michael.van.de.vanter@oracle.com>
date Mon, 14 Jul 2014 16:04:09 -0700
parents f1d839174e71
children abe7128ca473
files graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/NodeUtil.java
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/NodeUtil.java	Thu Jul 10 18:29:58 2014 +0200
+++ b/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/NodeUtil.java	Mon Jul 14 16:04:09 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -864,6 +864,9 @@
 
     private static String displaySourceAttribution(Node node) {
         final SourceSection section = node.getSourceSection();
+        if (section instanceof NullSourceSection) {
+            return "source: " + section.getShortDescription();
+        }
         if (section != null) {
             final String srcText = section.getCode();
             final StringBuilder sb = new StringBuilder();