This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]