summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDimitri van Heesch <doxygen@gmail.com>2019-08-26 18:41:47 (GMT)
committerDimitri van Heesch <doxygen@gmail.com>2019-08-26 18:41:47 (GMT)
commit8723f80b378bdd1c91ce3736ecece3ea06b89ff5 (patch)
tree9d0d8441fea0a83c68fb727ef3d91e544d7ee821 /src
parentb409bd0846b55a082919b757a310ce3873366341 (diff)
downloadDoxygen-8723f80b378bdd1c91ce3736ecece3ea06b89ff5.zip
Doxygen-8723f80b378bdd1c91ce3736ecece3ea06b89ff5.tar.gz
Doxygen-8723f80b378bdd1c91ce3736ecece3ea06b89ff5.tar.bz2
issue #7216: non-const getGroupDef() called on aliased member (cleanup + null pointer fix)
Diffstat (limited to 'src')
-rw-r--r--src/classdef.cpp6
-rw-r--r--src/docparser.cpp5
-rw-r--r--src/docparser.h3
-rw-r--r--src/doctokenizer.h5
-rw-r--r--src/doctokenizer.l14
-rw-r--r--src/filedef.cpp6
-rw-r--r--src/groupdef.cpp6
-rw-r--r--src/memberdef.cpp2
-rw-r--r--src/membergroup.cpp6
-rw-r--r--src/membergroup.h15
-rw-r--r--src/memberlist.cpp4
-rw-r--r--src/memberlist.h2
-rw-r--r--src/namespacedef.cpp6
-rw-r--r--src/pagedef.cpp2
14 files changed, 30 insertions, 52 deletions
diff --git a/src/classdef.cpp b/src/classdef.cpp
index 78284d5..b38518c 100644
--- a/src/classdef.cpp
+++ b/src/classdef.cpp
@@ -1276,14 +1276,14 @@ void ClassDefImpl::distributeMemberGroupDocumentation()
void ClassDefImpl::findSectionsInDocumentation()
{
- docFindSections(documentation(),this,0,docFile());
+ docFindSections(documentation(),this,docFile());
if (m_impl->memberGroupSDict)
{
MemberGroupSDict::Iterator mgli(*m_impl->memberGroupSDict);
MemberGroup *mg;
for (;(mg=mgli.current());++mgli)
{
- mg->findSectionsInDocumentation();
+ mg->findSectionsInDocumentation(this);
}
}
QListIterator<MemberList> mli(m_impl->memberLists);
@@ -1292,7 +1292,7 @@ void ClassDefImpl::findSectionsInDocumentation()
{
if ((ml->listType()&MemberListType_detailedLists)==0)
{
- ml->findSectionsInDocumentation();
+ ml->findSectionsInDocumentation(this);
}
}
}
diff --git a/src/docparser.cpp b/src/docparser.cpp
index 9dd1c71..2ee3d7d 100644
--- a/src/docparser.cpp
+++ b/src/docparser.cpp
@@ -7797,10 +7797,9 @@ DocText *validatingParseText(const char *input)
}
void docFindSections(const char *input,
- Definition *d,
- MemberGroup *mg,
+ const Definition *d,
const char *fileName)
{
- doctokenizerYYFindSections(input,d,mg,fileName);
+ doctokenizerYYFindSections(input,d,fileName);
}
diff --git a/src/docparser.h b/src/docparser.h
index e608d8f..84868f7 100644
--- a/src/docparser.h
+++ b/src/docparser.h
@@ -77,8 +77,7 @@ DocText *validatingParseText(const char *input);
/*! Searches for section and anchor commands in the input */
void docFindSections(const char *input,
- Definition *d,
- MemberGroup *m,
+ const Definition *d,
const char *fileName);
//---------------------------------------------------------------------------
diff --git a/src/doctokenizer.h b/src/doctokenizer.h
index b59fc09..f89069c 100644
--- a/src/doctokenizer.h
+++ b/src/doctokenizer.h
@@ -25,7 +25,6 @@
#include "htmlattrib.h"
class Definition;
-class MemberGroup;
enum Tokens
{
@@ -122,8 +121,8 @@ extern FILE *doctokenizerYYin;
const char *tokToString(int token);
// operations on the scanner
-void doctokenizerYYFindSections(const char *input,Definition *d,
- MemberGroup *mg,const char *fileName);
+void doctokenizerYYFindSections(const char *input,const Definition *d,
+ const char *fileName);
void doctokenizerYYinit(const char *input,const char *fileName);
void doctokenizerYYcleanup();
void doctokenizerYYpushContext();
diff --git a/src/doctokenizer.l b/src/doctokenizer.l
index 79c7d0e..6c02bcf 100644
--- a/src/doctokenizer.l
+++ b/src/doctokenizer.l
@@ -57,8 +57,7 @@ static bool g_insidePre;
static int g_sharpCount=0;
// context for section finding phase
-static Definition *g_definition;
-static MemberGroup *g_memberGroup;
+static const Definition *g_definition;
static QCString g_secLabel;
static QCString g_secTitle;
static SectionInfo::SectionType g_secType;
@@ -159,11 +158,7 @@ static void processSection()
{
//printf("%s: found section/anchor with name '%s'\n",g_fileName.data(),g_secLabel.data());
QCString file;
- if (g_memberGroup)
- {
- file = g_memberGroup->parent()->getOutputFileBase();
- }
- else if (g_definition)
+ if (g_definition)
{
file = g_definition->getOutputFileBase();
}
@@ -1369,8 +1364,8 @@ REFWORD_NOCV {FILEMASK}|{LABELID}|{REFWORD2_NOCV}|{REFWORD3}|{REFWORD4_NOCV}
//--------------------------------------------------------------------------
-void doctokenizerYYFindSections(const char *input,Definition *d,
- MemberGroup *mg,const char *fileName)
+void doctokenizerYYFindSections(const char *input,const Definition *d,
+ const char *fileName)
{
if (input==0) return;
printlex(yy_flex_debug, TRUE, __FILE__, fileName);
@@ -1378,7 +1373,6 @@ void doctokenizerYYFindSections(const char *input,Definition *d,
//printf("parsing --->'%s'<---\n",input);
g_inputPos = 0;
g_definition = d;
- g_memberGroup = mg;
g_fileName = fileName;
BEGIN(St_Sections);
doctokenizerYYlineno = 1;
diff --git a/src/filedef.cpp b/src/filedef.cpp
index 6c5ee58..e4f6c86 100644
--- a/src/filedef.cpp
+++ b/src/filedef.cpp
@@ -312,14 +312,14 @@ void FileDefImpl::distributeMemberGroupDocumentation()
void FileDefImpl::findSectionsInDocumentation()
{
- docFindSections(documentation(),this,0,docFile());
+ docFindSections(documentation(),this,docFile());
if (m_memberGroupSDict)
{
MemberGroupSDict::Iterator mgli(*m_memberGroupSDict);
MemberGroup *mg;
for (;(mg=mgli.current());++mgli)
{
- mg->findSectionsInDocumentation();
+ mg->findSectionsInDocumentation(this);
}
}
@@ -329,7 +329,7 @@ void FileDefImpl::findSectionsInDocumentation()
{
if (ml->listType()&MemberListType_declarationLists)
{
- ml->findSectionsInDocumentation();
+ ml->findSectionsInDocumentation(this);
}
}
}
diff --git a/src/groupdef.cpp b/src/groupdef.cpp
index 9baf0aa..e1fab11 100644
--- a/src/groupdef.cpp
+++ b/src/groupdef.cpp
@@ -236,12 +236,12 @@ void GroupDefImpl::distributeMemberGroupDocumentation()
void GroupDefImpl::findSectionsInDocumentation()
{
- docFindSections(documentation(),this,0,docFile());
+ docFindSections(documentation(),this,docFile());
MemberGroupSDict::Iterator mgli(*memberGroupSDict);
MemberGroup *mg;
for (;(mg=mgli.current());++mgli)
{
- mg->findSectionsInDocumentation();
+ mg->findSectionsInDocumentation(this);
}
QListIterator<MemberList> mli(m_memberLists);
@@ -250,7 +250,7 @@ void GroupDefImpl::findSectionsInDocumentation()
{
if (ml->listType()&MemberListType_declarationLists)
{
- ml->findSectionsInDocumentation();
+ ml->findSectionsInDocumentation(this);
}
}
}
diff --git a/src/memberdef.cpp b/src/memberdef.cpp
index 4fb0797..469275c 100644
--- a/src/memberdef.cpp
+++ b/src/memberdef.cpp
@@ -4923,7 +4923,7 @@ ClassDef *MemberDefImpl::accessorClass() const
void MemberDefImpl::findSectionsInDocumentation()
{
- docFindSections(documentation(),this,0,docFile());
+ docFindSections(documentation(),this,docFile());
}
void MemberDefImpl::enableCallGraph(bool e)
diff --git a/src/membergroup.cpp b/src/membergroup.cpp
index 3f0b144..c127302 100644
--- a/src/membergroup.cpp
+++ b/src/membergroup.cpp
@@ -351,10 +351,10 @@ void MemberGroup::addListReferences(Definition *def)
}
}
-void MemberGroup::findSectionsInDocumentation()
+void MemberGroup::findSectionsInDocumentation(const Definition *d)
{
- docFindSections(doc,0,this,m_docFile);
- memberList->findSectionsInDocumentation();
+ docFindSections(doc,d,m_docFile);
+ memberList->findSectionsInDocumentation(d);
}
void MemberGroup::setRefItems(const QList<ListItemInfo> *sli)
diff --git a/src/membergroup.h b/src/membergroup.h
index 248c8cb..c332b56 100644
--- a/src/membergroup.h
+++ b/src/membergroup.h
@@ -71,19 +71,7 @@ class MemberGroup
void countDocMembers();
int countGroupedInheritedMembers(MemberListType lt);
void distributeMemberGroupDocumentation();
- void findSectionsInDocumentation();
- /*
- int varCount() const;
- int funcCount() const;
- int enumCount() const;
- int enumValueCount() const;
- int typedefCount() const;
- int sequenceCount() const;
- int dictionaryCount() const;
- int protoCount() const;
- int defineCount() const;
- int friendCount() const;
- */
+ void findSectionsInDocumentation(const Definition *d);
int numDecMembers() const;
int numDecEnumValues() const;
int numDocMembers() const;
@@ -94,7 +82,6 @@ class MemberGroup
void addListReferences(Definition *d);
void setRefItems(const QList<ListItemInfo> *sli);
MemberList *members() const { return memberList; }
- const Definition *parent() const { return m_parent; }
QCString anchor() const;
QCString docFile() const { return m_docFile; }
diff --git a/src/memberlist.cpp b/src/memberlist.cpp
index 1869808..278023b 100644
--- a/src/memberlist.cpp
+++ b/src/memberlist.cpp
@@ -961,7 +961,7 @@ void MemberList::addListReferences(Definition *def)
}
}
-void MemberList::findSectionsInDocumentation()
+void MemberList::findSectionsInDocumentation(const Definition *d)
{
MemberListIterator mli(*this);
MemberDef *md;
@@ -975,7 +975,7 @@ void MemberList::findSectionsInDocumentation()
MemberGroup *mg;
for (;(mg=mgli.current());++mgli)
{
- mg->findSectionsInDocumentation();
+ mg->findSectionsInDocumentation(d);
}
}
}
diff --git a/src/memberlist.h b/src/memberlist.h
index 3c227be..0697df4 100644
--- a/src/memberlist.h
+++ b/src/memberlist.h
@@ -89,7 +89,7 @@ class MemberList : private QList<MemberDef>
void setInGroup(bool inGroup) { m_inGroup=inGroup; }
void setInFile(bool inFile) { m_inFile=inFile; }
void addListReferences(Definition *def);
- void findSectionsInDocumentation();
+ void findSectionsInDocumentation(const Definition *d);
void setNeedsSorting(bool b);
MemberGroupList *getMemberGroupList() const { return memberGroupList; }
void setAnonymousEnumType();
diff --git a/src/namespacedef.cpp b/src/namespacedef.cpp
index c0ae05d..9a98e0d 100644
--- a/src/namespacedef.cpp
+++ b/src/namespacedef.cpp
@@ -349,12 +349,12 @@ void NamespaceDefImpl::distributeMemberGroupDocumentation()
void NamespaceDefImpl::findSectionsInDocumentation()
{
- docFindSections(documentation(),this,0,docFile());
+ docFindSections(documentation(),this,docFile());
MemberGroupSDict::Iterator mgli(*memberGroupSDict);
MemberGroup *mg;
for (;(mg=mgli.current());++mgli)
{
- mg->findSectionsInDocumentation();
+ mg->findSectionsInDocumentation(this);
}
QListIterator<MemberList> mli(m_memberLists);
MemberList *ml;
@@ -362,7 +362,7 @@ void NamespaceDefImpl::findSectionsInDocumentation()
{
if (ml->listType()&MemberListType_declarationLists)
{
- ml->findSectionsInDocumentation();
+ ml->findSectionsInDocumentation(this);
}
}
}
diff --git a/src/pagedef.cpp b/src/pagedef.cpp
index 9f11eb0..8b6228f 100644
--- a/src/pagedef.cpp
+++ b/src/pagedef.cpp
@@ -99,7 +99,7 @@ PageDefImpl::~PageDefImpl()
void PageDefImpl::findSectionsInDocumentation()
{
- docFindSections(documentation(),this,0,docFile());
+ docFindSections(documentation(),this,docFile());
}
GroupDef *PageDefImpl::getGroupDef() const