[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Heap Corruption using MSVC (found the issue)
From: |
Jot Dot |
Subject: |
Heap Corruption using MSVC (found the issue) |
Date: |
Thu, 10 Dec 2020 17:35:30 -0700 (MST) |
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;
}
test.zip
Description: Zip archive
- Heap Corruption using MSVC (found the issue),
Jot Dot <=