Mercurial > hg > graal-jvmci-8
diff graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/parser/NodeParser.java @ 16907:09d99d3c0c95
Truffle-DSL: made guard parsing more robust.
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Sat, 23 Aug 2014 19:31:09 +0200 |
parents | 2db61eddcb97 |
children | 59bf50cc5a32 |
line wrap: on
line diff
--- a/graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/parser/NodeParser.java Sat Aug 23 19:31:01 2014 +0200 +++ b/graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/parser/NodeParser.java Sat Aug 23 19:31:09 2014 +0200 @@ -949,10 +949,8 @@ GuardParser parser = new GuardParser(context, node, source, expression); List<GuardData> matchingGuards = parser.parse(availableGuards); - if (!matchingGuards.isEmpty()) { - GuardData guard = matchingGuards.get(0); - // use the shared instance of the guard data - expression.setResolvedGuard(guard); + if (!matchingGuards.isEmpty() && matchingGuards.get(0) != null) { + expression.setResolvedGuard(matchingGuards.get(0)); } else { MethodSpec spec = parser.createSpecification(source.getMethod(), source.getMarkerAnnotation()); spec.applyTypeDefinitions("types");