From 526825bcee294cb20e37d8db6d5040ba0f8c428f Mon Sep 17 00:00:00 2001 From: Alexei Sheplyakov Date: Sat, 8 Aug 2009 13:07:14 +0300 Subject: [PATCH] symmetry::calchash(): be careful to not dereference past-the-end iterator. --- ginac/symmetry.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ginac/symmetry.cpp b/ginac/symmetry.cpp index 9e00a8c8..725506fa 100644 --- a/ginac/symmetry.cpp +++ b/ginac/symmetry.cpp @@ -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) { -- 2.44.0