Commit 6c0c2d87 by alokp@chromium.org

Do not call MacroExpander::popMacro() from MacroExpander::~MacroExpander().

MacroExpander::popMacro() assumes that the macro being popped has been fully parsed. This may not be true for MacroExpander destructor which may get called anytime the compiler decides to abort the compilation process. This patch just deletes the macro-contexts pushed in the stack without validating the parse state of current macro. BUG=348 Review URL: https://codereview.appspot.com/6415043 git-svn-id: https://angleproject.googlecode.com/svn/trunk@1227 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent 95c25cfc
#define MAJOR_VERSION 1
#define MINOR_VERSION 0
#define BUILD_VERSION 0
#define BUILD_REVISION 1226
#define BUILD_REVISION 1227
#define STRINGIFY(x) #x
#define MACRO_STRINGIFY(x) STRINGIFY(x)
......
......@@ -58,7 +58,10 @@ MacroExpander::MacroExpander(Lexer* lexer,
MacroExpander::~MacroExpander()
{
while (!mContextStack.empty()) popMacro();
for (size_t i = 0; i < mContextStack.size(); ++i)
{
delete mContextStack[i];
}
}
void MacroExpander::lex(Token* token)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment