oops...freeVars can return null.
authorbdemsky <bdemsky>
Mon, 16 Aug 2004 20:00:25 +0000 (20:00 +0000)
committerbdemsky <bdemsky>
Mon, 16 Aug 2004 20:00:25 +0000 (20:00 +0000)
Repair/RepairCompiler/MCC/IR/AbstractInterferes.java

index 31db16c..68ed221 100755 (executable)
@@ -155,16 +155,17 @@ class AbstractInterferes {
                } else return false; // bad match
            }
            Set freevars=rexpr1.freeVars();
-           for(Iterator it=freevars.iterator();it.hasNext();) {
-               VarDescriptor vd=(VarDescriptor)it.next();
-               if (vd.isGlobal())
-                   continue; //globals are fine
-               else if (varmap.containsKey(vd)&&onetoone) //the mapped variable is fine if we have a 1-1 mapping
-                   continue;
-               else if (termination.maxsize.getsize(vd.getSet())==1)
-                   continue;
-               return false;
-           }
+           if (freevars!=null)
+               for(Iterator it=freevars.iterator();it.hasNext();) {
+                   VarDescriptor vd=(VarDescriptor)it.next();
+                   if (vd.isGlobal())
+                       continue; //globals are fine
+                   else if (varmap.containsKey(vd)&&onetoone) //the mapped variable is fine if we have a 1-1 mapping
+                       continue;
+                   else if (termination.maxsize.getsize(vd.getSet())==1)
+                       continue;
+                   return false;
+               }
            return rexpr1.equals(varmap,rexpr2);
        }
        return false;