Repository navigation
Make use of new data type for lengths in ruby-4.1+ - #754
Merged
Merged
Conversation
cbandy
approved these changes
Oct 17, 2026
|
|
||
| if (cur_ptr < line_end_ptr) | ||
| rb_raise( rb_eArgError, "trailing data after binary array data at position: %ld", (long)(cur_ptr - input_line) + 1 ); | ||
| rb_raise( rb_eArgError, "trailing data after binary array data at position: %td", (cur_ptr - input_line) + 1 ); |
Collaborator
Author
There was a problem hiding this comment.
Thank you @cbandy for reviewing! I'll probably roll back the changes to print("%td..., because it breaks Truffleruby.
Truffleruby fails to print %td at runtime with:
expected ArgumentError with message matching /trailing data.*at position: 7$/, got #<ArgumentError: unhandled rb_sprintf arg type 26> with backtrace:
/home/runner/.rubies/truffleruby-head/lib/truffle/truffle/cext.rb:1369:in 'Truffle::CExt#rb_exc_raise'
/home/runner/.rubies/truffleruby-head/lib/truffle/truffle/cext_ruby.rb:83:in 'PG::BinaryDecoder::CopyRow#decode'
./spec/pg/type_spec.rb:1574:in 'block (7 levels) in <top (required)>'
./spec/pg/type_spec.rb:1574:in 'block (6 levels) in <top (required)>'
./spec/helpers.rb:64:in 'block in PG::TestingHelpers.included'
/home/runner/.rubies/truffleruby-head/lib/mri/rubygems.rb:304:in 'Gem.activate_and_load_bin_path'
./spec/pg/type_spec.rb:1574:in 'block (6 levels) in <top (required)>'
./spec/helpers.rb:64:in 'block in PG::TestingHelpers.included'
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See discussion in: https://bugs.ruby-lang.org/issues/22400