From a112faef52aca9c359cc5bf7058a77306238f897 Mon Sep 17 00:00:00 2001 From: triton Date: Fri, 31 Jan 2014 15:08:25 +0000 Subject: [PATCH] Fixed memory corruption bug by explicitly initializing the pointer to null. --- src/CppParser/Parser.cpp | 2 +- src/Parser/Parser.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/CppParser/Parser.cpp b/src/CppParser/Parser.cpp index 56bf0333..05d922d3 100644 --- a/src/CppParser/Parser.cpp +++ b/src/CppParser/Parser.cpp @@ -1977,7 +1977,7 @@ PreprocessedEntity* Parser::WalkPreprocessedEntity( auto& P = C->getPreprocessor(); - PreprocessedEntity* Entity; + PreprocessedEntity* Entity = 0; switch(PPEntity->getKind()) { diff --git a/src/Parser/Parser.cpp b/src/Parser/Parser.cpp index 55f03a90..4411d8ca 100644 --- a/src/Parser/Parser.cpp +++ b/src/Parser/Parser.cpp @@ -2000,7 +2000,7 @@ CppSharp::AST::PreprocessedEntity^ Parser::WalkPreprocessedEntity( auto& P = C->getPreprocessor(); - CppSharp::AST::PreprocessedEntity^ Entity; + CppSharp::AST::PreprocessedEntity^ Entity = nullptr; switch(PPEntity->getKind()) {