bug-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bug


From: Erlison Oliveira Santos
Subject: Bug
Date: Fri, 16 Feb 2001 17:19:06 -0300

Hi there 

We are running gcc 2.7.2.2 on a AIX 4.1. Our code has produced the 
following error: 

KaBrsRR.cpp: In method `int KaBrsWordGroups::parse(const class
String&)': 
KaBrsRR.cpp:181: Internal compiler error. 
KaBrsRR.cpp:181: Please submit a full bug report to
address@hidden'. 
make: 1254-004 The error code from the last command is 1. 

This is the source code that produces the error: 

  int KaBrsWordGroups::parse(const String &s) {
    WG_STRUC *wg = 0;
    int nWg = 0;
   WG_STRUC *aWg;
   WL_STRUC *wl;
   String para;
   String term; 
   int i, j, iWrd;

    fin(); 
    { 
      KaBrsWordGroupsParseDepends dependParser(itsSearchNum); 
      term = dependParser.process(s); 
      nDepends = dependParser.depends.Count(); 
      depends = KaNew(new unsigned long[nDepends==0 ? 1 : nDepends]); 
      for ( i = 1 ; i <= nDepends ; ++i ) { 
        depends[i-1] = *dependParser.depends.At(i); 
      } 
    } 

    setOperators((char **) opAr[0].p(), opAr[0].count(), 
                 (char **) opAr[1].p(), opAr[1].count(), 
                             (char *) epmOpenChar.C(), (char *) 
  epmCloseChar.C());        /* mj */ 

    //String sCopy(s);  // ParseWordGroups may change brakets to parens 
    //int r = ParseWordGroups((unsigned char*)sCopy.CString(),
WGD_PAREN, 
  &nWg, &wg); 
    int r = staticParseWordGroups(term, &para, &nWg, &wg); 

    if ( r == 0 && nWg > 0 ) { 
      int numWords = 0; 

      aWg = wg; 
      for ( i = 0 ; aWg != 0 && i < nWg ; ++i ) { 
        numWords += aWg->NumWords; 
        aWg = aWg->next; 
      } 
      if ( numWords == 0 ) 
        numWords = 1; 
      wgroup = new String[nWg]; 
      grp = new int[nWg+1]; 
      wrd = new String[numWords]; 
      if ( wgroup == 0 || grp == 0 || wrd == 0) 
        r = MEM_ALLOC_ERR; 
      else { 
        grp[0] = 0; 
        iWrd = 0; 
        aWg = wg; 
        for ( i = 0 ; aWg != 0 && i < nWg ; ++i ) { 
          wgroup[i] = aWg->string; 
          if ( wgroup[i].isInteger() ) 
            wgroup[i] = "\"" + wgroup[i] + "\""; 
          if ( para.exists() ) 
            wgroup[i] = KaBrsSet::lParen() + wgroup[i] + 
  KaBrsSet::rParen() + para; 
          grp[i+1] = grp[i] + aWg->NumWords; 
          wl = aWg->WordList; 
          for ( j = 0 ; wl != 0 && j < aWg->NumWords ; ++j ) { 
            wrd[iWrd++] = wl->string; 
            wl = wl->next; 
          } 
          aWg = aWg->next; 
        } 
      } 

      aWg = wg; 
      for ( i = 0 ; aWg != 0 && i < nWg ; ++i ) { 
        WG_STRUC *oldWg = aWg; 
        WL_STRUC *oldWl; 

        wl = aWg->WordList; 
        for ( j = 0 ; wl != 0 && j < aWg->NumWords ; ++j ) { 
          oldWl = wl; 
          if ( wl->string != 0 ) 
            free(wl->string); 
          wl = wl->next; 
          free(oldWl); 
        } 
        if ( aWg->string != 0 ) 
          free(aWg->string); 
        aWg = aWg->next; 
        free(oldWg); 
      } 
    } 

   setOperators(0, 0, 0, 0, "", ""); 

    if ( r == MEM_ALLOC_ERR ) 
      KaCheckNew(0); 
    if ( r == 0 ) 
      nGr = nWg; 
    return r; 
  } 
   

We are using the following compilor flags: 
gcc -g -fhandle-exceptions -c fonte.cpp -o fonte.o 

Any hints most welcome. 

Erlison



reply via email to

[Prev in Thread] Current Thread [Next in Thread]