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:30:04 +0000 (22:30 +0200)
(cherry picked from commit 526825bcee294cb20e37d8db6d5040ba0f8c428f)

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)
                {