Changeset 61c85ae in git for Singular/ipconv.cc


Ignore:
Timestamp:
Mar 8, 2017, 5:54:10 PM (7 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
5cc0fd21d7f549ea951ad44d836a08bb7bc146e5
Parents:
43fb497b3647d8eb6ab43424608bb388555ff96e
Message:
fix: move CleanUp for converted stuff to iiConvert
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/ipconv.cc

    r43fb497 r61c85ae  
    454454            number n=(pGetCoeff((poly)input->data));
    455455            n_Write(n, currRing->cf);
    456             (pGetCoeff((poly)input->data))=n;
     456            (pGetCoeff((poly)input->data))=n; // n_Write may have changed n
    457457            output->name=StringEndS();
    458458          }
     
    464464        number n=(number)input->data;
    465465        n_Write(n, currRing->cf);
    466         input->data=(void*)n;
     466        input->data=(void*)n; // n_Write may have changed n
    467467        output->name=StringEndS();
    468468      }
     
    471471        /* no need to preserve name: use it */
    472472        output->name=input->name;
    473         memset(input,0,sizeof(*input));
     473        input->name=NULL;
    474474      }
    475475    }
    476476    output->next=input->next;
    477477    input->next=NULL;
     478    if (!errorreported) input->CleanUp();
    478479    return errorreported;
    479480  }
     
    512513      output->next=input->next;
    513514      input->next=NULL;
    514   //if (outputType==MATRIX_CMD) Print("convert %d -> matrix\n",inputType);
     515      if ((input->rtyp!=IDHDL) && (input->attribute!=NULL))
     516      {
     517        input->attribute->killAll(currRing);
     518        input->attribute=NULL;
     519      }
     520      if (input->e!=NULL)
     521      {
     522        Subexpr h;
     523        while (input->e!=NULL)
     524        {
     525          h=input->e->next;
     526          omFreeBin((ADDRESS)input->e, sSubexpr_bin);
     527          input->e=h;
     528        }
     529      }
     530      //input->Init(); // seems that input (rtyp?) is still needed
    515531      return FALSE;
    516532    }
Note: See TracChangeset for help on using the changeset viewer.