From: bdemsky Date: Wed, 19 Oct 2005 19:48:33 +0000 (+0000) Subject: Fixed 0 case I think. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=6d0071755eb47752e4d2d731865a5c477cb64b60;p=repair.git Fixed 0 case I think. --- diff --git a/Repair/RepairCompiler/MCC/IR/DotExpr.java b/Repair/RepairCompiler/MCC/IR/DotExpr.java index 8da5317..d3caca9 100755 --- a/Repair/RepairCompiler/MCC/IR/DotExpr.java +++ b/Repair/RepairCompiler/MCC/IR/DotExpr.java @@ -385,7 +385,7 @@ public class DotExpr extends Expr { VarDescriptor rightside=VarDescriptor.makeNew("rightvalue"); writer.addDeclaration("int", rightside.getSafeSymbol()); rightexpr.generate(writer,rightside); - writer.outputline("if ("+numElements.getSafeSymbol()+"%"+leftside.getSafeSymbol()+"==0)"); + writer.outputline("if (("+leftside.getSafeSymbol()+"!=0) &&("+numElements.getSafeSymbol()+"%"+leftside.getSafeSymbol()+"==0))"); { writer.startblock(); VarDescriptor newvalue=VarDescriptor.makeNew("newvalue"); @@ -401,7 +401,7 @@ public class DotExpr extends Expr { writer.outputline("break;"); writer.endblock(); } - writer.outputline("else if ("+numElements.getSafeSymbol()+"%"+rightside.getSafeSymbol()+"==0)"); + writer.outputline("else if (("+rightside.getSafeSymbol()+"!=0)&&("+numElements.getSafeSymbol()+"%"+rightside.getSafeSymbol()+"==0))"); { writer.startblock(); VarDescriptor newvalue=VarDescriptor.makeNew("newvalue");