Buggy code:
public class IRBuilder19 extends IRBuilder { public IRBuilder19 ( IRManager manager ) { } protected Operand buildVersionSpecificNodes ( Node node , IRScope s ) { } protected LocalVariable getBlockArgVariable ( IRScope s , String name , int depth ) { } public void buildVersionSpecificBlockArgsAssignment ( Node node , IRScope s , Operand argsArray , int argIndex , boolean isMasgnRoot , boolean isClosureArg , boolean isSplat ) { } protected LocalVariable getArgVariable ( IRScope s , String name , int depth ) { } private void addArgReceiveInstr ( IRScope s , Variable v , int argIndex , boolean post , int numPreReqd , int numPostRead ) { } public void receiveRequiredArg ( Node node , IRScope s , int argIndex , boolean post , int numPreReqd , int numPostRead ) { } private void receiveClosureArg ( BlockArgNode blockVarNode , IRScope s ) { } public void receiveArgs ( final ArgsNode argsNode , IRScope s ) { } public void receiveBlockArgs ( final IterNode node , IRScope s ) { } public void receiveBlockClosureArg ( Node node , IRScope s ) { } public void receiveMethodArgs ( final ArgsNode argsNode , IRScope s ) { } protected void receiveArg ( IRScope s , Variable v , Operand argsArray , int argIndex , boolean isSplat ) { } public void buildArgsMasgn ( Node node , IRScope s , Operand argsArray , boolean isMasgnRoot , int preArgsCount , int postArgsCount , int index , boolean isSplat ) { } public void buildMultipleAsgn19Assignment ( final MultipleAsgn19Node multipleAsgnNode , IRScope s , Operand argsArray , Operand values ) { } @ Override public void buildVersionSpecificAssignment ( Node node , IRScope s , Variable v ) { } public Operand buildArgsPush ( final ArgsPushNode node , IRScope s ) { } public Operand buildEncoding ( EncodingNode node , IRScope s ) { } public Operand buildLambda ( LambdaNode node , IRScope s ) { IRClosure closure = new IRClosure ( s , false , node . getPosition ( ) . getStartLine ( ) , node . getScope ( ) , Arity . procArityOf ( node . getArgs ( ) ) , node . getArgumentType ( ) , true ) ; s . addClosure ( closure ) ; IRBuilder closureBuilder = createIRBuilder ( manager ) ; closure . addInstr ( new org . jruby . compiler . ir . instructions . ReceiveSelfInstruction ( getSelf ( closure ) ) ) ; closureBuilder . receiveBlockArgs ( node , closure ) ; closureBuilder . receiveBlockClosureArg ( node . getBlockVarNode ( ) , closure ) ; <START_BUG> Operand closureRetVal = closureBuilder . build ( node . getBody ( ) , closure ) ; <END_BUG> if ( closureRetVal != ( U_NIL ) ) closure . addInstr ( new org . jruby . compiler . ir . instructions . ClosureReturnInstr ( closureRetVal ) ) ; Variable lambda = s . getNewTemporaryVariable ( ) ; s . addInstr ( new org . jruby . compiler . ir . instructions . ruby19 . BuildLambdaInstr ( lambda , closure , node . getPosition ( ) ) ) ; return lambda ; } public Operand buildYield ( YieldNode node , IRScope s ) { } public Operand buildMultipleAsgn19 ( MultipleAsgn19Node multipleAsgnNode , IRScope s ) { } @ Override public Operand buildVersionSpecificGetDefinitionIR ( Node node , IRScope s ) { } }

Fix:
Operand closureRetVal = ( ( node . getBody ( ) ) == null ) ? Nil . NIL : closureBuilder . build ( node . getBody ( ) , closure ) ;