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 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;
 }