]> www.ginac.de Git - ginac.git/commitdiff
check_parameter_G: fix pontential increment of end().
authorAlexei Sheplyakov <varg@metalica.kh.ua>
Sat, 8 Aug 2009 10:06:36 +0000 (13:06 +0300)
committerJens Vollinga <jensv@nikhef.nl>
Sun, 9 Aug 2009 20:08:34 +0000 (22:08 +0200)
Incrementing past-the-end iterator is not permitted by the standard, see
[lib.input.iterators].

ginac/inifcns_nstdsums.cpp

index b4105338d329a118ba8317613a1aa5199566a592..11a91dd1eed81cc08dd1b69e72c5535013afe3c4 100644 (file)
@@ -659,6 +659,8 @@ Gparameter::const_iterator check_parameter_G(const Gparameter& a, int scale,
                        ++trailing_zeros;
                }
        }
+       if (lastnonzero == a.end())
+               return a.end();
        return ++lastnonzero;
 }