checkpoint
[sbp.git] / src / edu / berkeley / sbp / GSS.java
index 7af8b07..8412471 100644 (file)
@@ -338,11 +338,13 @@ public class GSS {
                 Forest[] holder = r.holder;
                 Forest old = holder[pos];
 
-                for(Forest result : results())
+                HashSet<Forest> rr = new HashSet<Forest>();
+                for(Forest result : results()) rr.add(result);
+                for(Forest result : rr)
                     for(Node child : ((Forest.Ref<?>)result).parents) {
                         if (only != null && child!=only) continue;
                         holder[pos] = result;
-                        if (pos==0) child.finish(r, r.rewrite(phase().getLocation()), target);
+                        if (pos==0) child.finish(r, r.rewrite(new Input.Region(child.phase().getLocation(), phase().getLocation())), target);
                         else        child.reduce(r, pos-1, target, null);
                     }