This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
C++ buggy code in debugging...
- From: Marcin Dalecki <martin at dalecki dot de>
- To: gcc at gcc dot gnu dot org
- Cc: Mark Mitchell <mark at codesourcery dot com>
- Date: Thu, 3 Feb 2005 23:27:26 +0100
- Subject: C++ buggy code in debugging...
I just wanted to give notice about the following buggy code found in
cp/parser.c:
/* Start emitting debugging information. */
static void
cp_lexer_start_debugging (cp_lexer* lexer)
{
++lexer->debugging_p;
}
/* Stop emitting debugging information. */
static void
cp_lexer_stop_debugging (cp_lexer* lexer)
{
--lexer->debugging_p;
}
Those two functions look like typical nesting specifications about the
debugging state inside
the parser. However the ->debugging_p field is defined as bool. And
there are actually places
where it is assigned true and false values. This is clearly a bug of
course.
One should either replace those places with proper usage of the above
functions or don't
use the nesting property apparently intended in the above.