-
Notifications
You must be signed in to change notification settings - Fork 234
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check for integer overflows in Ruby bindings #1572
Conversation
The method Any ideas how this could be solved? |
@saks Perhaps you have an idea to the above question? The matrix channel told me that you're the one who authored these bindings. |
@heinrich5991 , thanks for reaching out. I'll get back to you in a few hours. |
I like the idea to put this method into some module, the one defined as uniffi namespace should do. I've created this PR (https://github.com/heinrich5991/uniffi-rs/pull/1/files) to illustrate the idea. Please have a look and let me know |
The exception thrown is [`RangeError`](https://docs.ruby-lang.org/en/master/RangeError.html), like e.g. when doing `256.chr`. ``` > 256.chr (irb):1:in `chr': 256 out of char range (RangeError) from (irb):1:in `<main>' from /usr/lib/ruby/gems/3.0.0/gems/irb-1.4.2/exe/irb:11:in `<top (required)>' from /usr/bin/irb:25:in `load' from /usr/bin/irb:25:in `<main>' ```
f483110
to
ee58fb8
Compare
Thanks for the PR, I added the commit. |
The exception thrown is
RangeError
, like e.g. when doing256.chr
.