A small fix

Joseph Pallas pallas@CS.Stanford.EDU
Mon Oct 9 14:09:00 GMT 2000


I was never able to produce a small test-case for my crash, but I was able
to analyze it enough to convince myself that I understood the problem and
to hazard a fix.  I've been running with the following patch for some time
and I haven't seen any problems.  Most important, it cured my SEGV crashes
in dbimp.  All it does is specify that copies need to be made of macro
names when they're inserted in the search table, instead of using the
ephemeral string that was passed in.  I'm convinced it's harmless and
fixes at least one bug.

joe

Index: snavigator/parsers/cpp/cpplib/macro.c
===================================================================
RCS file: /home/pallas/cvsroot/source_navigator/snavigator/parsers/cpp/cpplib/macro.c,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 macro.c
*** macro.c	2000/08/14 20:58:28	1.1.1.1
--- macro.c	2000/09/01 17:33:41
***************
*** 90,96 ****
     entry.key_len  = sString.leng;
     entry.data     = 0;
     entry.data_len = 0;
!    entry.flag     = 0;
  
     if(( pentry = (*pbtrMacro->search)( &pbtrMacro, entry )))
     {
--- 90,96 ----
     entry.key_len  = sString.leng;
     entry.data     = 0;
     entry.data_len = 0;
!    entry.flag     = SEARCH_DUP_KEY;
  
     if(( pentry = (*pbtrMacro->search)( &pbtrMacro, entry )))
     {



More information about the Sourcenav mailing list