More bugs...
authorbdemsky <bdemsky>
Wed, 12 May 2004 21:40:03 +0000 (21:40 +0000)
committerbdemsky <bdemsky>
Wed, 12 May 2004 21:40:03 +0000 (21:40 +0000)
Repair/RepairCompiler/MCC/Compiler.java
Repair/RepairCompiler/MCC/IR/UpdateNode.java

index f10b39d879db782dd6ccc9861d5f337c8e96c714..abdf07cb19c1d6d55cdfb2d20efbe37b8687fe0f 100755 (executable)
@@ -22,7 +22,7 @@ public class Compiler {
     public static boolean AGGRESSIVESEARCH=false;
     public static boolean PRUNEQUANTIFIERS=false;
     public static boolean GENERATEDEBUGHOOKS=true;
     public static boolean AGGRESSIVESEARCH=false;
     public static boolean PRUNEQUANTIFIERS=false;
     public static boolean GENERATEDEBUGHOOKS=true;
-    public static boolean GENERATEDEBUGPRINT=true;
+    public static boolean GENERATEDEBUGPRINT=false;
 
     public static void main(String[] args) {
         State state = null;
 
     public static void main(String[] args) {
         State state = null;
index 397a7a7ce16b176748ba49b79c0eadb06be3245f..060c89ef4c4a2e46d239207d9dd5c7bfdc7b9495 100755 (executable)
@@ -419,11 +419,11 @@ class UpdateNode {
                    intindex.generate(cr,indexvd);
                FieldDescriptor fd=(FieldDescriptor)u.getDescriptor();
                StructureTypeDescriptor std=(StructureTypeDescriptor)subexpr.getType();
                    intindex.generate(cr,indexvd);
                FieldDescriptor fd=(FieldDescriptor)u.getDescriptor();
                StructureTypeDescriptor std=(StructureTypeDescriptor)subexpr.getType();
+               Expr offsetbits = std.getOffsetExpr(fd);
                if (fd instanceof ArrayDescriptor) {
                    fd = ((ArrayDescriptor) fd).getField();
                }
 
                if (fd instanceof ArrayDescriptor) {
                    fd = ((ArrayDescriptor) fd).getField();
                }
 
-               Expr offsetbits = std.getOffsetExpr(fd);
                if (intindex != null) {
                    Expr basesize = fd.getBaseSizeExpr();
                    offsetbits = new OpExpr(Opcode.ADD, offsetbits, new OpExpr(Opcode.MULT, basesize, intindex));
                if (intindex != null) {
                    Expr basesize = fd.getBaseSizeExpr();
                    offsetbits = new OpExpr(Opcode.ADD, offsetbits, new OpExpr(Opcode.MULT, basesize, intindex));
@@ -444,7 +444,7 @@ class UpdateNode {
                    } else if (rtd==ReservedTypeDescriptor.BIT) {
                        Expr tmp = new OpExpr(Opcode.SHL, offsetbytes, new IntegerLiteralExpr(3));
                        Expr offset=new OpExpr(Opcode.SUB, offsetbits, tmp);
                    } else if (rtd==ReservedTypeDescriptor.BIT) {
                        Expr tmp = new OpExpr(Opcode.SHL, offsetbytes, new IntegerLiteralExpr(3));
                        Expr offset=new OpExpr(Opcode.SUB, offsetbits, tmp);
-                       Expr mask=new OpExpr(Opcode.SHR, new IntegerLiteralExpr(1), offset);
+                       Expr mask=new OpExpr(Opcode.SHL, new IntegerLiteralExpr(1), offset);
                        VarDescriptor maskvar=VarDescriptor.makeNew("mask");
                        mask.generate(cr,maskvar);
                        cr.outputline("*((char *) "+addr.getSafeSymbol()+")|="+maskvar.getSafeSymbol()+";");
                        VarDescriptor maskvar=VarDescriptor.makeNew("mask");
                        mask.generate(cr,maskvar);
                        cr.outputline("*((char *) "+addr.getSafeSymbol()+")|="+maskvar.getSafeSymbol()+";");