Buggy code:
public Operand buildForIter ( final ForNode forNode , IRScope s ) { } public Operand buildGlobalAsgn ( GlobalAsgnNode globalAsgnNode , IRScope s ) { } public Operand buildGlobalVar ( GlobalVarNode node , IRScope s ) { } public Operand buildHash ( HashNode hashNode , IRScope s ) { } public Operand buildIf ( final IfNode ifNode , IRScope s ) { } public Operand buildInstAsgn ( final InstAsgnNode instAsgnNode , IRScope s ) { } public Operand buildInstVar ( InstVarNode node , IRScope s ) { } public Operand buildIter ( final IterNode iterNode , IRScope s ) { } public Operand buildLiteral ( LiteralNode literalNode , IRScope s ) { } public Operand buildLocalAsgn ( LocalAsgnNode localAsgnNode , IRScope s ) { } public Operand buildLocalVar ( LocalVarNode node , IRScope s ) { } public Operand buildMatch ( MatchNode matchNode , IRScope s ) { } public Operand buildMatch2 ( Match2Node matchNode , IRScope s ) { } private String getVarNameFromScopeTree ( IRScope scope , int depth , int offset ) { } public Operand buildMatch3 ( Match3Node matchNode , IRScope s ) { } private Operand getContainerFromCPath ( Colon3Node cpath , IRScope s ) { } public Operand buildModule ( ModuleNode moduleNode , IRScope s ) { } public Operand buildMultipleAsgn ( MultipleAsgnNode multipleAsgnNode , IRScope s ) { } public void buildMultipleAsgnAssignment ( final MultipleAsgnNode multipleAsgnNode , IRScope s , Operand argsArray , Operand values ) { } public Operand buildNewline ( NewlineNode node , IRScope s ) { } public Operand buildNext ( final NextNode nextNode , IRScope s ) { } public Operand buildNthRef ( NthRefNode nthRefNode , IRScope s ) { } public Operand buildNil ( ) { } public Operand buildOpAsgn ( OpAsgnNode opAsgnNode , IRScope s ) { } public Operand buildOpAsgnAnd ( OpAsgnAndNode andNode , IRScope s ) { } public Operand buildOpAsgnOr ( final OpAsgnOrNode orNode , IRScope s ) { } public Operand buildOpElementAsgn ( OpElementAsgnNode node , IRScope s ) { } public Operand buildOpElementAsgnWithOr ( OpElementAsgnNode opElementAsgnNode , IRScope s ) { } public Operand buildOpElementAsgnWithAnd ( OpElementAsgnNode opElementAsgnNode , IRScope s ) { } public Operand buildOpElementAsgnWithMethod ( OpElementAsgnNode opElementAsgnNode , IRScope s ) { } public Operand buildOr ( final OrNode orNode , IRScope s ) { } public Operand buildPostExe ( PostExeNode postExeNode , IRScope s ) { } public Operand buildPreExe ( PreExeNode preExeNode , IRScope s ) { } public Operand buildRational ( RationalNode rationalNode ) { } public Operand buildRedo ( IRScope s ) { } public Operand buildRegexp ( RegexpNode reNode , IRScope s ) { } public Operand buildRescue ( RescueNode node , IRScope s ) { } private Operand buildRescueInternal ( RescueNode rescueNode , IRScope s , IRBuilder . EnsureBlockInfo ensure ) { } private void outputExceptionCheck ( IRScope s , Operand excType , Operand excObj , Label caughtLabel ) { } private void buildRescueBodyInternal ( IRScope s , RescueBodyNode rescueBodyNode , Variable rv , Variable exc , Label endLabel ) { final Node exceptionList = rescueBodyNode . getExceptionNodes ( ) ; Label uncaughtLabel = s . getNewLabel ( ) ; Label caughtLabel = s . getNewLabel ( ) ; if ( exceptionList != null ) { if ( exceptionList instanceof ListNode ) { List < Operand > excTypes = new ArrayList < > ( ) ; for ( Node excType : exceptionList . childNodes ( ) ) { excTypes . add ( build ( excType , s ) ) ; } outputExceptionCheck ( s , new Array ( excTypes ) , exc , caughtLabel ) ; } else if ( exceptionList instanceof SplatNode ) { outputExceptionCheck ( s , build ( ( ( SplatNode ) ( exceptionList ) ) . getValue ( ) , s ) , exc , caughtLabel ) ; } else { outputExceptionCheck ( s , build ( exceptionList , s ) , exc , caughtLabel ) ; } } else { <START_BUG> Variable v = addResultInstr ( s , new InheritanceSearchConstInstr ( s . createTemporaryVariable ( ) , s . getCurrentModuleVariable ( ) , "StandardError" , false ) ) ; <END_BUG> outputExceptionCheck ( s , v , exc , caughtLabel ) ; } addInstr ( s , new LabelInstr ( uncaughtLabel ) ) ; if ( ( rescueBodyNode . getOptRescueNode ( ) ) != null ) { buildRescueBodyInternal ( s , rescueBodyNode . getOptRescueNode ( ) , rv , exc , endLabel ) ; } else { addInstr ( s , new ThrowExceptionInstr ( exc ) ) ; } addInstr ( s , new LabelInstr ( caughtLabel ) ) ; Node realBody = skipOverNewlines ( s , rescueBodyNode . getBodyNode ( ) ) ; Operand x = build ( realBody , s ) ; if ( x != ( IRBuilder . U_NIL ) ) { IRBuilder . RescueBlockInfo rbi = activeRescueBlockStack . peek ( ) ; addInstr ( s , new PutGlobalVarInstr ( "$!" , rbi . savedExceptionVariable ) ) ; addInstr ( s , new CopyInstr ( rv , x ) ) ; if ( ( ! ( activeEnsureBlockStack . empty ( ) ) ) && ( ( rbi . rescueNode ) == ( activeEnsureBlockStack . peek ( ) . matchingRescueNode ) ) ) { activeEnsureBlockStack . peek ( ) . cloneIntoHostScope ( this , s ) ; } addInstr ( s , new JumpInstr ( endLabel ) ) ; } } public Operand buildRetry ( IRScope s ) { } private Operand processEnsureRescueBlocks ( IRScope s , Operand retVal ) { } public Operand buildReturn ( ReturnNode returnNode , IRScope s ) { } public IREvalScript buildEvalRoot ( StaticScope staticScope , IRScope containingScope , String file , int lineNumber , RootNode rootNode , EvalType evalType ) { } public IRScriptBody buildRoot ( RootNode rootNode ) { } public Operand buildSelf ( IRScope s ) { } public Operand buildSplat ( SplatNode splatNode , IRScope s ) { } public Operand buildStr ( StrNode strNode , IRScope s ) { }

Fix:
Variable v = addResultInstr ( s , new InheritanceSearchConstInstr ( s . createTemporaryVariable ( ) , new ObjectClass ( ) , "StandardError" , false ) ) ;