diff options
author | Dimitri van Heesch <doxygen@gmail.com> | 2019-12-08 10:18:56 (GMT) |
---|---|---|
committer | Dimitri van Heesch <doxygen@gmail.com> | 2019-12-08 10:18:56 (GMT) |
commit | 6d4835dbe01a27923db8a1e4559b61da5065cb7a (patch) | |
tree | 9369a394c03978c79e20ec905cbd892e27fabdd6 /vhdlparser | |
parent | 4a4fcdf7931efba208a57b658185de689f2ef7fb (diff) | |
download | Doxygen-6d4835dbe01a27923db8a1e4559b61da5065cb7a.zip Doxygen-6d4835dbe01a27923db8a1e4559b61da5065cb7a.tar.gz Doxygen-6d4835dbe01a27923db8a1e4559b61da5065cb7a.tar.bz2 |
Changed std::unique_ptr<Entry> to std::shared_ptr<Entry> at avoid use after free issues
Diffstat (limited to 'vhdlparser')
-rw-r--r-- | vhdlparser/VhdlParser.cc | 2 | ||||
-rw-r--r-- | vhdlparser/VhdlParser.h | 3 | ||||
-rw-r--r-- | vhdlparser/vhdlparser.jj | 5 |
3 files changed, 4 insertions, 6 deletions
diff --git a/vhdlparser/VhdlParser.cc b/vhdlparser/VhdlParser.cc index 2ed30e2..35f2ff6 100644 --- a/vhdlparser/VhdlParser.cc +++ b/vhdlparser/VhdlParser.cc @@ -5891,7 +5891,7 @@ void VhdlParser::package_declaration() {QCString s; } if (!hasError) { lastCompound=current.get(); - std::unique_ptr<Entry> clone=std::make_unique<Entry>(*current); + std::shared_ptr<Entry> clone=std::make_shared<Entry>(*current); clone->section=Entry::NAMESPACE_SEC; clone->spec=VhdlDocGen::PACKAGE; clone->name=s; diff --git a/vhdlparser/VhdlParser.h b/vhdlparser/VhdlParser.h index a9f14d1..b88f156 100644 --- a/vhdlparser/VhdlParser.h +++ b/vhdlparser/VhdlParser.h @@ -8426,7 +8426,7 @@ static Entry* current_root; static Entry* tempEntry; static Entry* lastEntity ; static Entry* lastCompound ; -static std::unique_ptr<Entry> current; +static std::shared_ptr<Entry> current; static QCString compSpec; static QCString currName; static int levelCounter; @@ -8437,7 +8437,6 @@ static QCString forL; static int param_sec ; static int parse_sec; static int currP; -static Entry* currentCompound; //---------------------------------------- diff --git a/vhdlparser/vhdlparser.jj b/vhdlparser/vhdlparser.jj index a3d6731..c602396 100644 --- a/vhdlparser/vhdlparser.jj +++ b/vhdlparser/vhdlparser.jj @@ -31,7 +31,7 @@ static Entry* current_root; static Entry* tempEntry; static Entry* lastEntity ; static Entry* lastCompound ; -static std::unique_ptr<Entry> current; +static std::shared_ptr<Entry> current; static QCString compSpec; static QCString currName; static int levelCounter; @@ -42,7 +42,6 @@ static QCString forL; static int param_sec ; static int parse_sec; static int currP; -static Entry* currentCompound; //---------------------------------------- @@ -1730,7 +1729,7 @@ void package_declaration(): {QCString s;} <PACKAGE_T> s=identifier() <IS_T> { lastCompound=current.get(); - std::unique_ptr<Entry> clone=std::make_unique<Entry>(*current); + std::shared_ptr<Entry> clone=std::make_shared<Entry>(*current); clone->section=Entry::NAMESPACE_SEC; clone->spec=VhdlDocGen::PACKAGE; clone->name=s; |