Skip to content

Keep Newton division divisor alive - #548

Merged
tompng merged 1 commit into
ruby:masterfrom
OskarEichler:codex/keep-newton-divisor-alive
Sep 3, 2026
Merged

Keep Newton division divisor alive#548
tompng merged 1 commit into
ruby:masterfrom
OskarEichler:codex/keep-newton-divisor-alive

Conversation

@OskarEichler

Copy link
Copy Markdown
Contributor

Summary:

  • correct the second duplicated RB_GC_GUARD for a2 to guard b2
  • retain the divisor wrapper through the end of VpDivdNewtonInner

Why:
The method constructs a2, b2, c2 and r2, but its final guards name a2 twice and omit b2. The duplicate is a maintenance/liveness typo at a native GC boundary.

Verification:

  • full current suite: 266 tests, 13,616 assertions, 0 failures/errors/omissions
  • RBS suite: 146 tests, 1,805 assertions, 0 failures/errors
  • 25 GC.stress division comparisons pass before and after the correction

Compatibility:
No arithmetic behavior changes. This makes the existing lifetime intent explicit; the stress model did not reproduce a user-visible crash on the tested runtime.

@tompng tompng left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch! Thanks

@tompng
tompng merged commit 483ea9d into ruby:master Sep 3, 2026
83 checks passed
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.

2 participants