Mercurial > hg > graal-compiler
diff graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/typesystem/ImplicitCastData.java @ 12452:5f022aa41631
Truffle-DSL: fixed an NPE if invalid TypeData are compared.
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Wed, 16 Oct 2013 18:25:16 +0200 |
parents | 2fb276f5e3e9 |
children |
line wrap: on
line diff
--- 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); } - }