Changeset 5ec9be in git for kernel/GBEngine


Ignore:
Timestamp:
Dec 8, 2021, 8:45:50 PM (2 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'd08f5f0bb3329b8ca19f23b74cb1473686415c3a')
Children:
b88651a797221664e3ac3f76aa6416eb7d9d9e95
Parents:
a3c2d148f63eb8d89dc8e26eb3d09063b2fa6590
Message:
fix: memory leak in NF in LP case
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/GBEngine/kstd2.cc

    ra3c2d14 r5ec9be  
    309309        if (j > strat->tl) return -1;
    310310#if defined(PDEBUG) || defined(PDIV_DEBUG)
    311         if (p_LmShortDivisibleBy(T[j].p, sevT[j],p, not_sev, r))
     311        if ((T[j].p!=NULL)
     312        && p_LmShortDivisibleBy(T[j].p, sevT[j],p, not_sev, r))
    312313        {
    313314          if(n_DivBy(pGetCoeff(p), pGetCoeff(T[j].p), r->cf))
     
    315316        }
    316317#else
    317         if (!(sevT[j] & not_sev) &&
    318           p_LmDivisibleBy(T[j].p, p, r))
     318        if (!(sevT[j] & not_sev)
     319        && (T[j].p!=NULL)
     320        && p_LmDivisibleBy(T[j].p, p, r))
    319321        {
    320322          if(n_DivBy(pGetCoeff(p), pGetCoeff(T[j].p), r->cf))
     
    331333        if (j > strat->tl) return -1;
    332334#if defined(PDEBUG) || defined(PDIV_DEBUG)
    333         if (p_LmShortDivisibleBy(T[j].p, sevT[j],p, not_sev, r))
     335        if ((T[j].p!=NULL)
     336        && p_LmShortDivisibleBy(T[j].p, sevT[j],p, not_sev, r))
    334337        {
    335338          return j;
    336339        }
    337340#else
    338         if (!(sevT[j] & not_sev) &&
    339           p_LmDivisibleBy(T[j].p, p, r))
     341        if (!(sevT[j] & not_sev)
     342        && (T[j].p!=NULL)
     343        && p_LmDivisibleBy(T[j].p, p, r))
    340344        {
    341345          return j;
     
    46174621        for (int j = 0; j<=strat->tl; ++j)
    46184622        {
    4619           // this is like clearS in bba, but we reduce with elements from T, because it contains the shifts too
    4620           assume(strat->sevT[j] == pGetShortExpVector(strat->T[j].p));
    4621           assume(strat->sevS[k] == pGetShortExpVector(strat->S[k]));
    4622           if (pLmShortDivisibleBy(strat->T[j].p, strat->sevT[j], strat->S[k], ~strat->sevS[k]))
     4623          if (strat->T[j].p!=NULL)
    46234624          {
    4624             if (pLmCmp(strat->T[j].p, strat->S[k]) != 0)
    4625             { // check whether LM is different
    4626               deleteInS(k, strat);
    4627               --k;
    4628               break;
     4625            // this is like clearS in bba, but we reduce with elements from T, because it contains the shifts too
     4626            assume(strat->sevT[j] == pGetShortExpVector(strat->T[j].p));
     4627            assume(strat->sevS[k] == pGetShortExpVector(strat->S[k]));
     4628            if (pLmShortDivisibleBy(strat->T[j].p, strat->sevT[j], strat->S[k], ~strat->sevS[k]))
     4629            {
     4630              if (pLmCmp(strat->T[j].p, strat->S[k]) != 0)
     4631              { // check whether LM is different
     4632                deleteInS(k, strat);
     4633                --k;
     4634                break;
     4635              }
    46294636            }
    46304637          }
Note: See TracChangeset for help on using the changeset viewer.