Re: [GNU Bison 3.8.2] testsuite: 764 failed

YunQiang Su <[email protected]> Wed, 28 Jan 2026 17:02:14 +0800
Newsgroups gmane.comp.parsers.bison.bugs
Message-ID <[email protected]>
I met the same problem on Linux, and I find that it only appears build =
with -O0 or -D_GLIBCXX_ASSERTIONS

With gdb, I tried to debug=20

    void
    yyremoveDeletes ()
    {
      size_t newsize =3D yystates.size ();
      /* j is the number of live stacks we have seen.  */
      for (size_t i =3D 0, j =3D 0; j < newsize; ++i)
        {
          if (yystates[i] =3D=3D YY_NULLPTR)
            {
              if (i =3D=3D j)
                {
                  YYCDEBUG << "Removing dead stacks.\n";
                }
              newsize -=3D 1;
            }
          else
            {
              yystates[j] =3D yystates[i];
              /* In the current implementation, it's unnecessary to copy
                 yylookaheadNeeds[i] since, after
                 yyremoveDeletes returns, the parser immediately either =
enters
                 deterministic operation or shifts a token.  However, it =
doesn't
                 hurt, and the code might evolve to need it.  */
              yylookaheadNeeds[j] =3D yylookaheadNeeds[i];
              if (j !=3D i)
                {
                  YYCDEBUG << "Rename stack " << i << " -> " << j << =
".\n";
                }
              j +=3D 1;
            }
        }
      yystates.resize (newsize);
      yylookaheadNeeds.resize (newsize);
    }


`yylookaheadNeeds[j] =3D yylookaheadNeeds[i];` do have some problems:
In the 3rd time we use `yyremoveDeletes`, the length of `yystates` is 1, =
while the
length of yylookaheadNeeds is 0.=