From d79d4d2b198964d340ebf4f77ce062eacee42478 Mon Sep 17 00:00:00 2001 From: bdemsky Date: Tue, 18 May 2004 19:11:07 +0000 Subject: [PATCH 1/1] Bugs with generating ands and ors...ahh. --- Repair/RepairCompiler/MCC/IR/OpExpr.java | 6 +++--- Repair/RepairCompiler/MCC/specs/freeciv/test.constraints | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Repair/RepairCompiler/MCC/IR/OpExpr.java b/Repair/RepairCompiler/MCC/IR/OpExpr.java index 3fe5297..2364436 100755 --- a/Repair/RepairCompiler/MCC/IR/OpExpr.java +++ b/Repair/RepairCompiler/MCC/IR/OpExpr.java @@ -335,7 +335,7 @@ public class OpExpr extends Expr { if ((opcode==Opcode.OR)|| (opcode==Opcode.AND)) { writer.outputline("int "+lm.getSafeSymbol()+"=maybe;"); - writer.outputline("int maybe=0;"); + writer.outputline("maybe=0;"); } rd = VarDescriptor.makeNew("rightop"); @@ -353,12 +353,12 @@ public class OpExpr extends Expr { } else if (opcode == Opcode.AND) { writer.outputline("int "+rm.getSafeSymbol()+"=maybe;"); writer.outputline("maybe = (" + ld.getSafeSymbol() + " && " + rm.getSafeSymbol() + ") || (" + rd.getSafeSymbol() + " && " + lm.getSafeSymbol() + ") || (" + lm.getSafeSymbol() + " && " + rm.getSafeSymbol() + ");"); - writer.outputline(dest.getSafeSymbol() + " = " + ld.getSafeSymbol() + " && " + rd.getSafeSymbol() + ";"); + writer.outputline("int "+dest.getSafeSymbol() + " = " + ld.getSafeSymbol() + " && " + rd.getSafeSymbol() + ";"); } else if (opcode == Opcode.OR) { writer.outputline("int "+rm.getSafeSymbol()+"=maybe;"); writer.outputline("maybe = (!" + ld.getSafeSymbol() + " && " + rm.getSafeSymbol() + ") || (!" + rd.getSafeSymbol() + " && " + lm.getSafeSymbol() + ") || (" + lm.getSafeSymbol() + " && " + rm.getSafeSymbol() + ");"); - writer.outputline(dest.getSafeSymbol() + " = " + ld.getSafeSymbol() + " || " + rd.getSafeSymbol() + + writer.outputline("int "+dest.getSafeSymbol() + " = " + ld.getSafeSymbol() + " || " + rd.getSafeSymbol() + ";"); } else if (opcode != Opcode.NOT) { /* two operands */ assert rd != null; diff --git a/Repair/RepairCompiler/MCC/specs/freeciv/test.constraints b/Repair/RepairCompiler/MCC/specs/freeciv/test.constraints index 9899a73..edd8039 100755 --- a/Repair/RepairCompiler/MCC/specs/freeciv/test.constraints +++ b/Repair/RepairCompiler/MCC/specs/freeciv/test.constraints @@ -1,5 +1,5 @@ [],sizeof(MAP)=1; [],sizeof(GRID)=1; -[forall t in TILE],t.TERRAIN>=0 and t.TERRAIN<=13; +[forall t in TILE],t.TERRAIN>=0 and t.TERRAIN<=12; [forall c in CITY],sizeof(c.~CITYMAP)=1; [forall c in CITY],!c.~CITYMAP.TERRAIN=7; -- 2.34.1