Changeset 8e903f in git for kernel/GBEngine/kspoly.cc


Ignore:
Timestamp:
Apr 24, 2020, 7:01:53 PM (4 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', '17f1d200f27c5bd38f5dfc6e8a0879242279d1d8')
Children:
34ac5c4176020d530d61125750c8457430cd7f22
Parents:
b94a72a3900cee27c0409f0d8cfe58d9e880654c756dc7155d3cba64f765acc3475e5c4e12cdbbff
git-author:
Hans Schoenemann <hannes@mathematik.uni-kl.de>2020-04-24 19:01:53+02:00
git-committer:
GitHub <noreply@github.com>2020-04-24 19:01:53+02:00
Message:
Merge pull request #990 from kabouzeid/stable

Fix segfault because of components in LP
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/GBEngine/kspoly.cc

    r756dc7 r8e903f  
    312312}
    313313
     314#ifdef HAVE_RINGS
    314315int ksReducePolyGCD(LObject* PR,
    315316                 TObject* PW,
     
    399400    ct = n_ExtGcd(pGetCoeff(p1), pGetCoeff(p2), &an, &bn, tailRing->cf);    // Calculate GCD
    400401#ifdef HAVE_SHIFTBBA
    401     if (n_IsZero(an, tailRing->cf) || n_IsZero(bn, tailRing->cf))
    402     {
    403       // NOTE: not sure why this is not checked in the commutative case, this *does* happen and then zero coeff errors are reported
    404 
    405       // NOTE: we are probably leaking memory of lm=pOne(), but we cannot delete it since it could also be lm=p1
    406       n_Delete(&an, tailRing->cf);
    407       n_Delete(&bn, tailRing->cf);
    408       n_Delete(&ct, tailRing->cf);
    409       return ret;
     402    if(rIsLPRing(tailRing)) /* with this test: error at New/stdZtests.tst, infinite : Long/primdecint.tst */
     403    {
     404      if (n_IsZero(an, tailRing->cf) || n_IsZero(bn, tailRing->cf))
     405      {
     406        // NOTE: not sure why this is not checked in the commutative case, this *does* happen and then zero coeff errors are reported
     407        // NOTE: we are probably leaking memory of lm=pOne(), but we cannot delete it since it could also be lm=p1
     408        n_Delete(&an, tailRing->cf);
     409        n_Delete(&bn, tailRing->cf);
     410        n_Delete(&ct, tailRing->cf);
     411        return ret;
     412      }
    410413    }
    411414#endif
     
    437440  return ret;
    438441}
     442#endif
    439443
    440444/* Computes a reduction of the lead coefficient only. We have already tested
     
    14131417#ifdef HAVE_SHIFTBBA
    14141418  int shift1, shift2;
    1415   if (tailRing->isLPring) {
     1419  if (tailRing->isLPring)
     1420  {
    14161421    // assume: LM is shifted, tail unshifted
    14171422    assume(p_FirstVblock(a1, tailRing) <= 1);
Note: See TracChangeset for help on using the changeset viewer.