Skip to content

Commit

Permalink
[Truffle] Guard against potential dead nodes appearing in if/else cla…
Browse files Browse the repository at this point in the history
…uses.
  • Loading branch information
nirvdrum committed Feb 9, 2015
1 parent c4185ef commit 1fd8e8a
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -1448,13 +1448,13 @@ public RubyNode visitIfNode(org.jruby.ast.IfNode node) {

org.jruby.ast.Node thenBody = node.getThenBody();

if (thenBody == null) {
if (thenBody == null || thenBody.isNil()) {
thenBody = new org.jruby.ast.NilNode(node.getPosition());
}

org.jruby.ast.Node elseBody = node.getElseBody();

if (elseBody == null) {
if (elseBody == null || elseBody.isNil()) {
elseBody = new org.jruby.ast.NilNode(node.getPosition());
}

Expand Down

0 comments on commit 1fd8e8a

Please sign in to comment.