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:29:48 +0000 (22:29 +0200)
Incrementing past-the-end iterator is not permitted by the standard, see
[lib.input.iterators].
(cherry picked from commit 49a44f7d55ec0d6686d3c32c7081a07d10c93274)

ginac/inifcns_nstdsums.cpp

index b410533..11a91dd 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;
 }