Detect recursive subtree cycles at parse time (fixes #979) by facontidavide · Pull Request #1085 · BehaviorTree/BehaviorTree.CPP · GitHub
Skip to content

Detect recursive subtree cycles at parse time (fixes #979)#1085

Merged
facontidavide merged 2 commits into
masterfrom
fix/detect-recursive-subtrees
Feb 1, 2026
Merged

Detect recursive subtree cycles at parse time (fixes #979)#1085
facontidavide merged 2 commits into
masterfrom
fix/detect-recursive-subtrees

Conversation

@facontidavide

Copy link
Copy Markdown
Collaborator

Replaces #980

Use an ancestor set passed through recursivelyCreateSubtree to detect
cycles, avoiding the substring-matching false positives of a prefix
path check.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Feb 1, 2026

Copy link
Copy Markdown

Avoids copying the set at each recursive call. Uses insert-on-entry
and erase-on-exit (DFS backtracking) so sibling subtrees sharing the
same ID are handled correctly.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@facontidavide facontidavide merged commit 0125875 into master Feb 1, 2026
13 checks passed
@facontidavide facontidavide deleted the fix/detect-recursive-subtrees branch February 1, 2026 19:53
@codecov

codecov Bot commented Feb 1, 2026

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant