Commit 4f3d212
committed
S_uv_mul_overflow in inline.h: Add casts to make multiplications done in UV
If C compiler doesn't know __builtin_mul_overflow, S_uv_mul_overflow
will be implemented with fallback "long multiplication" algorithm,
but it had a bug that elemental multiplications were done in unsigned
long precision instead of UV precision. It will lead wrong result
when unsigned long is narrower than UV (for example -Duse64bitint
on 32-bit platform).1 parent f288bce commit 4f3d212
1 file changed
+4
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3546 | 3546 | | |
3547 | 3547 | | |
3548 | 3548 | | |
| 3549 | + | |
| 3550 | + | |
3549 | 3551 | | |
3550 | 3552 | | |
3551 | 3553 | | |
| |||
3567 | 3569 | | |
3568 | 3570 | | |
3569 | 3571 | | |
3570 | | - | |
| 3572 | + | |
3571 | 3573 | | |
3572 | 3574 | | |
3573 | 3575 | | |
| |||
3576 | 3578 | | |
3577 | 3579 | | |
3578 | 3580 | | |
3579 | | - | |
| 3581 | + | |
3580 | 3582 | | |
3581 | 3583 | | |
3582 | 3584 | | |
| |||
0 commit comments