forked from bytecodealliance/javy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: quickjs-wasm-sys: properly handle shifts by 32 in libbf.c
As reported upstream in bellard/quickjs#131: shifting by `(LIMB_BITS - shift)` when `LIMB_BITS == 32` and `shift == 0` produces wrong results on 32-bit targets. This fix replaces all occurences of `(LIMB_BITS - shift)` with calls to the existing helpers: `shld()` and `shrd`, which are moved to the beginning of the file so that they are defined before their new usages. The helpers properly handle the cases when `shift` is zero. Fixes issue 556
- Loading branch information
Showing
1 changed file
with
22 additions
and
23 deletions.
There are no files selected for viewing
This file contains 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