[Gecode] bug: equal and the empty set

Grégoire Dooms dooms at info.ucl.ac.be
Mon May 23 17:28:17 CEST 2005


Hi,
Here is an example code for a bug I ran into : void equals(Space *, 
SetVar x, SetVar y)
segfaults  when y is instanciated to the empty set.

I also attach a patch against set/reified/propagators.cc 1.25
(this is a CVS version Christian sent me a few weeks ago - I have no CVS 
access).

All the best,
--
Grégoire Dooms


-------------- next part --------------
A non-text attachment was scrubbed...
Name: bug.cc
Type: text/x-c++src
Size: 959 bytes
Desc: not available
Url : http://www.ps.uni-sb.de/pipermail/gecode-users/attachments/20050523/3ea35cc7/bug-0002.cc
-------------- next part --------------
--- propagators.cc.orig	2005-05-23 17:13:35.000000000 +0200
+++ propagators.cc	2005-05-23 17:16:25.000000000 +0200
@@ -226,13 +226,12 @@
       // directly test x0==x1
       GlbIter<SetView> x0lb(x0);
       GlbIter<SetView> x1lb(x1);
-      for (; x0lb(); ++x0lb) {
+      for (; x0lb() && x1lb(); ++x0lb, ++x1lb) {
         if (x0lb.min() != x1lb.min() ||
             x0lb.max() != x1lb.max()) {
           b.t_zero_none(home);
           return ES_SUBSUMED;
         }
-        ++x1lb;
       }
       b.t_one_none(home);
       return ES_SUBSUMED;


More information about the gecode-users mailing list