From 76ef6aac6ad4ef33d648689589a26e73b92897cc Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Fri, 13 Sep 2013 12:39:49 +0200 Subject: [PATCH] QDoc: properly initialize a member MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Spotted by valgrind: ==14189== Conditional jump or move depends on uninitialised value(s) ==14189== at 0x47B3FD: DocParser::parse(QString const&, DocPrivate*, QSet const&, QSet const&) (doc.cpp:1627) ==14189== by 0x4818AC: Doc::Doc(Location const&, Location const&, QString const&, QSet const&, QSet const&) (doc.cpp:2755) ==14189== by 0x4E6C3D: PureDocParser::processQdocComments() (puredocparser.cpp:140) ==14189== by 0x4E6A9E: PureDocParser::parseSourceFile(Location const&, QString const&) (puredocparser.cpp:109) ==14189== by 0x4D2E4C: processQdocconfFile(QString const&) (main.cpp:473) ==14189== by 0x4D3B3C: main (main.cpp:656) ==14189== Uninitialised value was created by a heap allocation ==14189== at 0x4C2B1C7: operator new(unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==14189== by 0x474378: DocPrivate::constructExtra() (doc.cpp:415) ==14189== by 0x47B975: DocParser::insertTarget(QString const&, bool) (doc.cpp:1676) ==14189== by 0x476B52: DocParser::parse(QString const&, DocPrivate*, QSet const&, QSet const&) (doc.cpp:956) ==14189== by 0x4818AC: Doc::Doc(Location const&, Location const&, QString const&, QSet const&, QSet const&) (doc.cpp:2755) ==14189== by 0x4E6C3D: PureDocParser::processQdocComments() (puredocparser.cpp:140) ==14189== by 0x4E6A9E: PureDocParser::parseSourceFile(Location const&, QString const&) (puredocparser.cpp:109) ==14189== by 0x4D2E4C: processQdocconfFile(QString const&) (main.cpp:473) ==14189== by 0x4D3B3C: main (main.cpp:656) Change-Id: I5c50c6611a1d901cc19d12bc3757977c36b2a73b Reviewed-by: Martin Smith Reviewed-by: Topi Reiniƶ --- src/tools/qdoc/doc.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/tools/qdoc/doc.cpp b/src/tools/qdoc/doc.cpp index 1e0c66cd08..6e70671d1d 100644 --- a/src/tools/qdoc/doc.cpp +++ b/src/tools/qdoc/doc.cpp @@ -325,7 +325,9 @@ public: QStringMultiMap metaMap; DocPrivateExtra() - : granularity(Doc::Part) { } + : granularity(Doc::Part) + , section(Doc::NoSection) + { } }; struct Shared // ### get rid of