Changeset 69d7df in git


Ignore:
Timestamp:
Nov 15, 2013, 4:06:00 PM (9 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', '5bec8f88c9ee2573d328cf7c3aff2bcb301d2395')
Children:
c6f0451f6fc744c2dac1401c4d9346c784f6b28b
Parents:
4b5171ff486c46e0d3f30c8810fc2bb7ebd00157
git-author:
Hans Schoenemann <hannes@mathematik.uni-kl.de>2013-11-15 16:06:00+01:00
git-committer:
Hans Schoenemann <hannes@mathematik.uni-kl.de>2013-11-15 16:06:45+01:00
Message:
fix: handling of potential ring-dep objects (def,list) in newstruct
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/newstruct.cc

    r4b5171 r69d7df  
    128128  for(;n>=0;n--)
    129129  {
    130     if (RingDependend(L->m[n].rtyp))
     130    if (RingDependend(L->m[n].rtyp)
     131    ||((L->m[n].rtyp==LIST_CMD)&&lRingDependend((lists)L->m[n].data)))
    131132    {
    132133      assume((L->m[n-1].rtyp==RING_CMD) || (L->m[n-1].data==NULL));
     
    368369            return r==NULL;
    369370          }
    370           else if (RingDependend(nm->typ))
     371          else if (RingDependend(nm->typ)
     372          || (al->m[nm->pos].RingDependend()))
    371373          {
    372374            if (al->m[nm->pos].data==NULL)
     
    400402            }
    401403          }
     404          else if ((nm->typ==DEF_CMD)||(nm->typ==LIST_CMD))
     405          {
     406            if (al->m[nm->pos-1].data==NULL)
     407            {
     408              al->m[nm->pos-1].data=(void*)currRing;
     409              if (currRing!=NULL) currRing->ref++;
     410            }
     411          }
    402412          Subexpr r=(Subexpr)omAlloc0Bin(sSubexpr_bin);
    403413          r->start = nm->pos+1;
     
    516526  {
    517527    l->m[nm->pos].rtyp=nm->typ;
    518     if (RingDependend(nm->typ))
     528    if (RingDependend(nm->typ) ||(nm->typ==DEF_CMD)||(nm->typ==LIST_CMD))
    519529      l->m[nm->pos-1].rtyp=RING_CMD;
    520530    l->m[nm->pos].data=idrecDataInit(nm->typ);
     
    667677      return NULL;
    668678    }
    669     if (RingDependend(t))
     679    if (RingDependend(t) || (t==DEF_CMD)||(t==LIST_CMD))
    670680      res->size++;    // one additional field for the ring (before the data)
    671681    //Print("found type %s at real-pos %d",start,res->size);
     
    708718  currRingHdl=save_ring;
    709719  //Print("new type with %d elements\n",res->size);
     720  //newstructShow(res);
    710721  return res;
    711722error_in_newstruct_def:
     
    757768  {
    758769    Print(">>%s<< at pos %d, type %d (%s)\n",elem->name,elem->pos,elem->typ,Tok2Cmdname(elem->typ));
    759     if (RingDependend(elem->typ))
     770    if (RingDependend(elem->typ)|| (elem->typ==DEF_CMD) ||(elem->typ==LIST_CMD))
    760771      Print(">>r_%s<< at pos %d, shadow ring\n",elem->name,elem->pos-1);
    761772    elem=elem->next;
Note: See TracChangeset for help on using the changeset viewer.