Changeset 951177 in git for Singular


Ignore:
Timestamp:
Nov 10, 2016, 11:15:31 AM (7 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
dfda213f61263ad8410b207a93bc8a2718a3edc0
Parents:
ebfa7a9d174387b333fddda2c3d8d1442a078310
Message:
fix: crash at defining proc in .lib and .so twice (LIB"gfan.lib";LIB"gfan.lib";)
Location:
Singular
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • Singular/ipid.cc

    rebfa7a r951177  
    656656{
    657657  (pi->ref)--;
    658   if (pi->ref <= 0)
     658  if (pi->ref == 0)
    659659  {
    660660    if (pi->language==LANG_SINGULAR)
  • Singular/iplib.cc

    rebfa7a r951177  
    926926  {
    927927    pi = IDPROC(h);
    928     omfree(pi->libname);
    929     pi->libname = omStrDup(libname);
    930     omfree(pi->procname);
    931     pi->procname = omStrDup(procname);
    932     pi->language = LANG_C;
    933     pi->ref = 1;
    934     pi->is_static = pstatic;
    935     pi->data.o.function = func;
     928    if((pi->language == LANG_SINGULAR)
     929    ||(pi->language == LANG_NONE))
     930    {
     931      omfree(pi->libname);
     932      pi->libname = omStrDup(libname);
     933      omfree(pi->procname);
     934      pi->procname = omStrDup(procname);
     935      pi->language = LANG_C;
     936      pi->ref = 1;
     937      pi->is_static = pstatic;
     938      pi->data.o.function = func;
     939    }
     940    else if(pi->language == LANG_C)
     941    {
     942      if(pi->data.o.function == func)
     943      {
     944        pi->ref++;
     945      }
     946      else
     947      {
     948        omfree(pi->libname);
     949        pi->libname = omStrDup(libname);
     950        omfree(pi->procname);
     951        pi->procname = omStrDup(procname);
     952        pi->language = LANG_C;
     953        pi->ref = 1;
     954        pi->is_static = pstatic;
     955        pi->data.o.function = func;
     956      }
     957    }
     958    else
     959      Warn("internal error: unknown procedure type %d",pi->language);
    936960    return(1);
    937961  }
Note: See TracChangeset for help on using the changeset viewer.