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 3fe5297..2364436 100755 (executable)
@@ -335,7 +335,7 @@ public class OpExpr extends Expr {
            if ((opcode==Opcode.OR)||
                (opcode==Opcode.AND)) {
                writer.outputline("int "+lm.getSafeSymbol()+"=maybe;");
            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");
            }
 
             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() + ");");
         } 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() + ");");
        } 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;
                              ";");
        } else if (opcode != Opcode.NOT) { /* two operands */
             assert rd != null;
index 9899a73..edd8039 100755 (executable)
@@ -1,5 +1,5 @@
 [],sizeof(MAP)=1;
 [],sizeof(GRID)=1;
 [],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;
 [forall c in CITY],sizeof(c.~CITYMAP)=1;
 [forall c in CITY],!c.~CITYMAP.TERRAIN=7;