Skip to content

Validate Fiber quantum values#1

Draft
FletcherDares wants to merge 1 commit into
samuel-williams-shopify:fiber-preemptionfrom
FletcherDares:fiber-quantum-validation
Draft

Validate Fiber quantum values#1
FletcherDares wants to merge 1 commit into
samuel-williams-shopify:fiber-preemptionfrom
FletcherDares:fiber-quantum-validation

Conversation

@FletcherDares
Copy link
Copy Markdown

@FletcherDares FletcherDares commented May 12, 2026

This adds shared validation for Fiber quantum inputs so both Fiber.new(quantum:) and Fiber#quantum= reject invalid values consistently.\n\nChanges:\n- Reject Float values instead of truncating them through NUM2UINT.\n- Reject non-positive values before unsigned conversion so negative values do not wrap.\n- Preserve RangeError for values outside the uint32 storage range.\n- Add coverage in test/ruby/test_fiber.rb and spec/ruby/core/fiber/quantum_spec.rb.\n\nVerification:\n- make -j8 miniruby\n- make test-all TESTS='../ruby-pr-16886/test/ruby/test_fiber.rb -n /quantum/'\n- make test-spec SPECOPTS=../ruby-pr-16886/spec/ruby/core/fiber/quantum_spec.rb

DRAFT!!!!

@FletcherDares FletcherDares marked this pull request as draft May 12, 2026 23:08
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