Skip to content

Guard against an include/extend cycle in on_ancestors_updated - #473

Merged
mame merged 1 commit into
masterfrom
extend-cycle-guard
Sep 1, 2026
Merged

Guard against an include/extend cycle in on_ancestors_updated#473
mame merged 1 commit into
masterfrom
extend-cycle-guard

Conversation

@mame

@mame mame commented Sep 1, 2026

Copy link
Copy Markdown
Member

module Foo; module Util; include Foo; end; extend Util; end is valid Ruby but made on_ancestors_updated recurse until SystemStackError. include/prepend cycles are rejected by Ruby itself, so extend was the first way to reach it. Add the same guard each_descendant has, plus scenarios for extend resolution.

`module Foo; module Util; include Foo; end; extend Util; end` is valid Ruby but
made `on_ancestors_updated` recurse until SystemStackError. `include`/`prepend`
cycles are rejected by Ruby itself, so `extend` was the first way to reach it.
Add the same guard `each_descendant` has, plus scenarios for extend resolution.
@mame
mame enabled auto-merge (rebase) September 1, 2026 08:47
@mame
mame merged commit 4fdef96 into master Sep 1, 2026
12 checks passed
@mame
mame deleted the extend-cycle-guard branch September 1, 2026 08:47
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