bug fix
authorbdemsky <bdemsky@uci.edu>
Thu, 2 Aug 2018 19:47:43 +0000 (12:47 -0700)
committerbdemsky <bdemsky@uci.edu>
Thu, 2 Aug 2018 19:47:43 +0000 (12:47 -0700)
src/csolver.cc

index b42dbe0..58177a5 100644 (file)
@@ -520,8 +520,14 @@ void CSolver::addConstraint(BooleanEdge constraint) {
                        BooleanLogic *b = (BooleanLogic *) constraint.getBoolean();
                        if (!constraint.isNegated()) {
                                if (b->op == SATC_AND) {
-                                       for (uint i = 0; i < b->inputs.getSize(); i++) {
-                                               addConstraint(b->inputs.get(i));
+                                       uint size = b->inputs.getSize();
+                                       //Handle potential concurrent modification
+                                       BooleanEdge array[size];
+                                       for (uint i = 0; i < size; i++) {
+                                               array[i] = b->inputs.get(i);
+                                       }
+                                       for (uint i = 0; i < size; i++) {
+                                               addConstraint(array[i]);
                                        }
                                        return;
                                }