Buggy code:
public class BinaryExpr extends Expr { private Expr left ; private Expr right ; private BinaryOp op ; private int leftLine ; private int leftCol ; private int rightLine ; private int rightCol ; public BinaryExpr ( Expr l , Expr r , BinaryOp o , int ellineNum , int elcolNum , int erlineNum , int ercolNum ) { } public Expr getLeft ( ) { } public Expr getRight ( ) { } public BinaryOp getOp ( ) { } public Type typecheck ( SymTab s ) { } @ Override public Expr constantFold ( ) { } public IRExpr buildIRExpr ( ) { switch ( op ) { case PLUS : { <START_BUG> if ( ( ( left . getType ( ) ) != null ) && ( left . getType ( ) . equals ( new Type ( "int" ) ) ) ) { <END_BUG> return new IRBinOp ( OpType . ADD , left . buildIRExpr ( ) , right . buildIRExpr ( ) ) ; } ArrayList < IRStmt > sequence = new ArrayList < IRStmt > ( ) ; String leftside = LabelMaker . Generate_Unique_Label ( "_STRING_CONCAT_LEFT" ) ; String rightside = LabelMaker . Generate_Unique_Label ( "_STRING_CONCAT_RIGHT" ) ; sequence . add ( new IRMove ( new IRTemp ( leftside ) , left . buildIRExpr ( ) ) ) ; sequence . add ( new IRMove ( new IRTemp ( rightside ) , right . buildIRExpr ( ) ) ) ; sequence . add ( new IRMove ( new IRTemp ( "_STRING_CONCAT_LLEN" ) , new IRMem ( new IRBinOp ( OpType . SUB , new IRTemp ( leftside ) , new IRConst ( 8 ) ) ) ) ) ; sequence . add ( new IRMove ( new IRTemp ( "_STRING_CONCAT_RLEN" ) , new IRMem ( new IRBinOp ( OpType . SUB , new IRTemp ( rightside ) , new IRConst ( 8 ) ) ) ) ) ; sequence . add ( new IRMove ( new IRTemp ( "_STRING_CONCAT_LENGTH" ) , new IRBinOp ( OpType . ADD , new IRTemp ( "_STRING_CONCAT_LLEN" ) , new IRTemp ( "_STRING_CONCAT_RLEN" ) ) ) ) ; sequence . add ( new IRMove ( new IRTemp ( "_STRING_CONCAT_LOC" ) , new IRCall ( new IRName ( "_I_alloc_i" ) , new IRBinOp ( OpType . MUL , new IRBinOp ( OpType . ADD , new IRTemp ( "_STRING_CONCAT_LENGTH" ) , new IRConst ( 1 ) ) , new IRConst ( 8 ) ) ) ) ) ; sequence . add ( new IRMove ( new IRMem ( new IRTemp ( "_STRING_CONCAT_LOC" ) ) , new IRTemp ( "_STRING_CONCAT_LENGTH" ) ) ) ; sequence . add ( new IRMove ( new IRTemp ( "_STRING_CONCAT_COUNTER" ) , new IRConst ( 8 ) ) ) ; sequence . add ( new IRMove ( new IRTemp ( "_STRING_CONCAT_LCOUNTER" ) , new IRConst ( 0 ) ) ) ; sequence . add ( new IRMove ( new IRTemp ( "_STRING_CONCAT_RCOUNTER" ) , new IRConst ( 0 ) ) ) ; String uleft_label_start = LabelMaker . Generate_Unique_Label ( "_STRING_CONCAT_LLOOP_START" ) ; String uright_label_start = LabelMaker . Generate_Unique_Label ( "_STRING_CONCAT_RLOOP_START" ) ; String udone_label = LabelMaker . Generate_Unique_Label ( "_STRING_CONCAT_DONE" ) ; sequence . add ( new IRLabel ( uleft_label_start ) ) ; sequence . add ( new IRCJump ( new IRBinOp ( OpType . GEQ , new IRTemp ( "_STRING_CONCAT_LCOUNTER" ) , new IRTemp ( "_STRING_CONCAT_LLEN" ) ) , uright_label_start ) ) ; sequence . add ( new IRMove ( new IRMem ( new IRBinOp ( OpType . ADD , new IRTemp ( "_STRING_CONCAT_LOC" ) , new IRTemp ( "_STRING_CONCAT_COUNTER" ) ) ) , new IRMem ( new IRBinOp ( OpType . ADD , new IRTemp ( leftside ) , new IRBinOp ( OpType . MUL , new IRTemp ( "_STRING_CONCAT_LCOUNTER" ) , new IRConst ( 8 ) ) ) ) ) ) ; sequence . add ( new IRMove ( new IRTemp ( "_STRING_CONCAT_COUNTER" ) , new IRBinOp ( OpType . ADD , new IRTemp ( "_STRING_CONCAT_COUNTER" ) , new IRConst ( 8 ) ) ) ) ; sequence . add ( new IRMove ( new IRTemp ( "_STRING_CONCAT_LCOUNTER" ) , new IRBinOp ( OpType . ADD , new IRTemp ( "_STRING_CONCAT_LCOUNTER" ) , new IRConst ( 1 ) ) ) ) ; sequence . add ( new IRJump ( new IRName ( uleft_label_start ) ) ) ; sequence . add ( new IRLabel ( uright_label_start ) ) ; sequence . add ( new IRCJump ( new IRBinOp ( OpType . GEQ , new IRTemp ( "_STRING_CONCAT_RCOUNTER" ) , new IRTemp ( "_STRING_CONCAT_RLEN" ) ) , udone_label ) ) ; sequence . add ( new IRMove ( new IRMem ( new IRBinOp ( OpType . ADD , new IRTemp ( "_STRING_CONCAT_LOC" ) , new IRTemp ( "_STRING_CONCAT_COUNTER" ) ) ) , new IRMem ( new IRBinOp ( OpType . ADD , new IRTemp ( rightside ) , new IRBinOp ( OpType . MUL , new IRTemp ( "_STRING_CONCAT_RCOUNTER" ) , new IRConst ( 8 ) ) ) ) ) ) ; sequence . add ( new IRMove ( new IRTemp ( "_STRING_CONCAT_COUNTER" ) , new IRBinOp ( OpType . ADD , new IRTemp ( "_STRING_CONCAT_COUNTER" ) , new IRConst ( 8 ) ) ) ) ; sequence . add ( new IRMove ( new IRTemp ( "_STRING_CONCAT_RCOUNTER" ) , new IRBinOp ( OpType . ADD , new IRTemp ( "_STRING_CONCAT_RCOUNTER" ) , new IRConst ( 1 ) ) ) ) ; sequence . add ( new IRJump ( new IRName ( uright_label_start ) ) ) ; sequence . add ( new IRLabel ( udone_label ) ) ; return new IRESeq ( new IRSeq ( sequence ) , new IRBinOp ( OpType . ADD , new IRTemp ( "_STRING_CONCAT_LOC" ) , new IRConst ( 8 ) ) ) ; } case MINUS : return new IRBinOp ( OpType . SUB , left . buildIRExpr ( ) , right . buildIRExpr ( ) ) ;

Fix:
if ( ( ( left . getType ( ) ) != null ) && ( left . getType ( ) . equals ( new Type ( "int" , 0 ) ) ) ) {