Mercurial > hg > truffle
diff graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/generator/TypeSystemCodeGenerator.java @ 21742:2e850dbf82ae
Truffle-DSL: fix NPE in getImplicitCastType if an implicitely casted type is short circuited. (reported-by: Mohaned Qunaibit)
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Fri, 05 Jun 2015 14:12:49 +0200 |
parents | 9a83732f97eb |
children |
line wrap: on
line diff
--- a/graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/generator/TypeSystemCodeGenerator.java Fri Jun 05 13:04:40 2015 +0200 +++ b/graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/generator/TypeSystemCodeGenerator.java Fri Jun 05 14:12:49 2015 +0200 @@ -410,6 +410,11 @@ builder.end(); } + builder.startElseIf().string(LOCAL_VALUE).string(" == ").nullLiteral().end(); + builder.startBlock(); + builder.startReturn().typeLiteral(context.getType(Object.class)).end(); + builder.end(); + builder.startElseBlock(); builder.tree(createTransferToInterpreterAndInvalidate()); builder.startThrow().startNew(context.getType(IllegalArgumentException.class)).doubleQuote("Illegal type ").end().end();