re: Posting in help-bison, same topic

I have isolated the problem with my code.
If (in my .y file) I do not have this defined:

%define parse.trace

then I get a heap corruption error.
By simply adding that line, the corruption disappears.

Attached is a heavily chopped down MSVC solution that demonstrates it.
The entire main program (in test.cpp) is simply:

#include <stdio.h>

#include "driver.h"
#include "scanner.h"

int main(int argc, char* argv[])
{

        Driver driver;

        gen::Parser* pParser = new gen::Parser(&driver);

        // Heap corruption when the .y file does not have %define parse.trace
        // If we add the define, the corruption disappears
        delete pParser; // <<<=== Heap corruption detected

        return 0;
}

<<attachment: test.zip>>

Reply via email to