changeset 22480:56a37a3ee60b

Truffle/Source: fix bug in LineLocation comparison
author Michael Van De Vanter <michael.van.de.vanter@oracle.com>
date Mon, 07 Dec 2015 12:49:17 -0800
parents e1d15415bb2e
children 825d0d0301c9
files truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/source/LineLocation.java
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/source/LineLocation.java	Mon Dec 07 11:04:48 2015 -0800
+++ b/truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/source/LineLocation.java	Mon Dec 07 12:49:17 2015 -0800
@@ -93,10 +93,12 @@
         int sourceResult = 0;
         final Source thisSource = this.getSource();
         final String thisPath = thisSource.getPath();
-        if (thisPath == null) {
+        final String otherPath = o.getSource().getPath();
+
+        if (thisPath == null || otherPath == null) {
             sourceResult = thisSource.getCode().compareTo(o.getSource().getCode());
         } else {
-            final String thatPath = o.getSource().getPath();
+            final String thatPath = otherPath;
             sourceResult = thisPath.compareTo(thatPath);
         }
         if (sourceResult != 0) {