-
Notifications
You must be signed in to change notification settings - Fork 791
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
mrb_int_mul_overflow is missing #3149
Comments
Is it available in C99? |
It would be mostly the same as https://github.com/mruby/mruby/blob/master/include/mruby/numeric.h#L40, so i guess its not in C99 too. |
I'm not familiar enough with the builtin overflows, maybe matz can advise |
I'll add it. The difficult part here is the fallback for compilers without these built-ins. It needs to be portable and fast. Of course, only to some degree. With 16/32 b |
Currently multiplications aren't checked for overflowing, there is __builtin_mul_overflow in GCC/Clang etc. I just don't know how to implement it in compilers which lack it.
The text was updated successfully, but these errors were encountered: