Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
doxverilog
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
doxverilog
Commits
c83db38e
Commit
c83db38e
authored
Nov 02, 2014
by
Dimitri van Heesch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Debian Bug 762272: segfault with cyclic subgroups
parent
a31c9fff
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
10 deletions
+41
-10
groupdef.cpp
src/groupdef.cpp
+41
-10
No files found.
src/groupdef.cpp
View file @
c83db38e
...
@@ -510,7 +510,31 @@ void GroupDef::removeMember(MemberDef *md)
...
@@ -510,7 +510,31 @@ void GroupDef::removeMember(MemberDef *md)
bool
GroupDef
::
containsGroup
(
const
GroupDef
*
def
)
bool
GroupDef
::
containsGroup
(
const
GroupDef
*
def
)
{
{
return
this
==
def
||
groupList
->
find
(
def
)
>=
0
;
if
(
this
==
def
)
{
return
TRUE
;
}
else
if
(
groupList
->
find
(
def
)
>=
0
)
{
return
TRUE
;
}
else
// look for subgroups as well
{
GroupList
*
groups
=
partOfGroups
();
if
(
groups
)
{
GroupListIterator
it
(
*
groups
);
GroupDef
*
gd
;
for
(;(
gd
=
it
.
current
());
++
it
)
{
if
(
gd
->
containsGroup
(
def
))
{
return
TRUE
;
}
}
}
}
return
FALSE
;
}
}
void
GroupDef
::
addGroup
(
const
GroupDef
*
def
)
void
GroupDef
::
addGroup
(
const
GroupDef
*
def
)
...
@@ -1346,16 +1370,23 @@ void addGroupToGroups(Entry *root,GroupDef *subGroup)
...
@@ -1346,16 +1370,23 @@ void addGroupToGroups(Entry *root,GroupDef *subGroup)
for
(;(
g
=
gli
.
current
());
++
gli
)
for
(;(
g
=
gli
.
current
());
++
gli
)
{
{
GroupDef
*
gd
=
0
;
GroupDef
*
gd
=
0
;
if
(
!
g
->
groupname
.
isEmpty
()
&&
(
gd
=
Doxygen
::
groupSDict
->
find
(
g
->
groupname
))
&&
if
(
!
g
->
groupname
.
isEmpty
()
&&
(
gd
=
Doxygen
::
groupSDict
->
find
(
g
->
groupname
)))
!
gd
->
containsGroup
(
subGroup
)
)
{
gd
->
addGroup
(
subGroup
);
subGroup
->
makePartOfGroup
(
gd
);
}
else
if
(
gd
==
subGroup
)
{
{
warn
(
root
->
fileName
,
root
->
startLine
,
"Trying to add group %s to itself!"
,
if
(
gd
==
subGroup
)
gd
->
name
().
data
());
{
warn
(
root
->
fileName
,
root
->
startLine
,
"Refusing to add group %s to itself"
,
gd
->
name
().
data
());
}
else
if
(
gd
->
containsGroup
(
subGroup
))
{
warn
(
root
->
fileName
,
root
->
startLine
,
"Refusing to add group %s to group %s, since the latter is already a "
"subgroup of the former
\n
"
,
subGroup
->
name
().
data
(),
gd
->
name
().
data
());
}
else
{
gd
->
addGroup
(
subGroup
);
subGroup
->
makePartOfGroup
(
gd
);
}
}
}
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment