summaryrefslogtreecommitdiff
path: root/libvaladoc
diff options
context:
space:
mode:
authorRico Tzschichholz <ricotz@ubuntu.com>2019-07-30 12:54:56 +0200
committerRico Tzschichholz <ricotz@ubuntu.com>2019-09-04 09:32:44 +0200
commitd144372cfd690471ce9253fbff72de7b66015a72 (patch)
treec1da625881c1727ba78c2988a29d13c71316b810 /libvaladoc
parent4e695a4e374df741859651f62e9a554f55991aac (diff)
downloadvala-d144372cfd690471ce9253fbff72de7b66015a72.tar.gz
libvaladoc: Don't traverse into close circles with parent
SymbolResolver.resolve_thrown_list() adds error-type nodes which are allowed to be NodeType.ERROR_DOMAIN and NodeType.CLASS. This can result in a cycle on invoking Node.accept_all_children(), Node.parse_comments() or Node.check_comments() Fixes https://gitlab.gnome.org/GNOME/vala/issues/829
Diffstat (limited to 'libvaladoc')
-rw-r--r--libvaladoc/api/node.vala9
1 files changed, 9 insertions, 0 deletions
diff --git a/libvaladoc/api/node.vala b/libvaladoc/api/node.vala
index 079c7ee44..6b41e5e9e 100644
--- a/libvaladoc/api/node.vala
+++ b/libvaladoc/api/node.vala
@@ -118,6 +118,9 @@ public abstract class Valadoc.Api.Node : Item, Documentation {
do_document = true;
foreach (Node node in per_name_children.get_values ()) {
+ if (this.parent == node) {
+ continue;
+ }
if (node.is_browsable (settings)) {
node.parse_comments (settings, parser);
}
@@ -130,6 +133,9 @@ public abstract class Valadoc.Api.Node : Item, Documentation {
internal override void check_comments (Settings settings, DocumentationParser parser) {
foreach (Node node in per_name_children.get_values ()) {
+ if (this.parent == node) {
+ continue;
+ }
if (node.is_browsable (settings)) {
node.check_comments (settings, parser);
}
@@ -277,6 +283,9 @@ public abstract class Valadoc.Api.Node : Item, Documentation {
*/
public void accept_all_children (Visitor visitor, bool filtered = true) {
foreach (Vala.List<Node> children in per_type_children.get_values ()) {
+ if (this.parent == children[0]) {
+ continue;
+ }
foreach (Node node in children) {
if (node.do_document || !filtered) {
node.accept (visitor);