This repository was archived by the owner on Nov 1, 2021. It is now read-only.
Add a workaround for Safari 9 ARM iOS right shift by non-immediate zero JIT bug #231
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.
I do not unfortunately have a small test case, since it somehow interacts with JIT, and simple
emscripten_request_animation_frame()based attempts to build a repro that'd get fed to a JIT after some warm-up runs ended up empty.The original issue occurs on stb_image codebase in function
https://github.com/nothings/stb/blob/e6afb9cbae4064da8c3e69af3ff5c4629579c1d2/deprecated/stb_image.c#L1999-L2005
on the right shift on the last return line, when loading up a png image; where it is observed that
v==16222142, a non-zero non-negative i32 number, andbits==16, yielding a shift right by 0, but the expression would compute16222142 >> 0 == 0and return 0.Verified this patch to fix the above
stb_imageloading code. The odd thing is that the patch was supposed to have landed on Feb 15th 2016, but iOS 9.3.5 was released only much later on August 25th, but the observed symptoms fit the description of the issue in https://bugs.webkit.org/show_bug.cgi?id=151514 perfectly, so very probable that was the cause.