symmetry::calchash(): be careful to not dereference past-the-end iterator.
authorAlexei Sheplyakov <varg@metalica.kh.ua>
Sat, 8 Aug 2009 10:07:14 +0000 (13:07 +0300)
committerJens Vollinga <jensv@nikhef.nl>
Sun, 9 Aug 2009 20:16:18 +0000 (22:16 +0200)
ginac/symmetry.cpp

index 9e00a8c..725506f 100644 (file)
@@ -190,7 +190,8 @@ unsigned symmetry::calchash() const
 
        if (type == none) {
                v = rotate_left(v);
-               v ^= *(indices.begin());
+               if (!indices.empty())
+                       v ^= *(indices.begin());
        } else {
                for (exvector::const_iterator i=children.begin(); i!=children.end(); ++i)
                {