# HG changeset patch # User Christian Humer # Date 1381940716 -7200 # Node ID 5f022aa4163162a350e049aa4f63d56a75b4edef # Parent 47eb670c163449c1e951b4efe4849ff4972043a4 Truffle-DSL: fixed an NPE if invalid TypeData are compared. diff -r 47eb670c1634 -r 5f022aa41631 graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/typesystem/ImplicitCastData.java --- a/graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/typesystem/ImplicitCastData.java Mon Oct 14 18:48:21 2013 +0200 +++ b/graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/typesystem/ImplicitCastData.java Wed Oct 16 18:25:16 2013 +0200 @@ -45,13 +45,14 @@ @Override public int compareTo(TemplateMethod o) { - if (o instanceof ImplicitCastData) { + if (o instanceof ImplicitCastData && sourceType != null) { // implicit casts are ordered by source type since // its also the order in which they are checked. TypeData otherSourceType = ((ImplicitCastData) o).getSourceType(); - return this.sourceType.compareTo(otherSourceType); + if (otherSourceType != null) { + return this.sourceType.compareTo(otherSourceType); + } } return super.compareTo(o); } - }