Bugs with generating ands and ors...ahh.
authorbdemsky <bdemsky>
Tue, 18 May 2004 19:11:07 +0000 (19:11 +0000)
committerbdemsky <bdemsky>
Tue, 18 May 2004 19:11:07 +0000 (19:11 +0000)
Repair/RepairCompiler/MCC/IR/OpExpr.java
Repair/RepairCompiler/MCC/specs/freeciv/test.constraints

index 3fe5297050b4c68c6efc1bd1d1c9ff21f3734fae..23644364db60649b6a49b0e227405be1b741fa91 100755 (executable)
@@ -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;
index 9899a73828b0e50bc742857e21aafcd11f37b3b7..edd80391968be418fa59e12485f898eeabaf898f 100755 (executable)
@@ -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;