Additional enhancements to compute mustremove and cantremove sets for
[repair.git] / Repair / RepairCompiler / MCC / IR / Updates.java
index a4e6d801654d56d2e54de76a00659671342909bc..f17d9564253cd9785be07832a5851518641708ff 100755 (executable)
@@ -57,7 +57,14 @@ class Updates {
            return ((VarExpr)leftexpr).getVar();
        } else if (isField()) {
            Expr e=leftexpr;
-           for(;e instanceof DotExpr;e=((DotExpr)e).getExpr()) ;
+           do {
+               for(;e instanceof DotExpr;e=((DotExpr)e).getExpr()) ;
+               if (e instanceof VarExpr)
+                   break;
+               if (e instanceof CastExpr)
+                   e=((CastExpr)e).getExpr();
+               else throw new Error("Unrecognized Expr:"+e.name());
+           } while(true);
            return ((VarExpr)e).getVar();
        } else {
            System.out.println(toString());