Conversation
|
@nesbox Please merge, this causes a crash on using any decimal value in a JS cart in 1.2. (NOTE: |
|
Hmm, I'm not sure we need it here. It might be better to sync our submodule with the official QuickJS repo instead. |
|
That's a fork, not the official QuickJS repo; the official QuickJS repo is https://github.com/bellard/quickjs. (Not to say we couldn't use QuickJS-NG instead, but that's a different discussion than "just use the official upstream repo".) If it were me in this position, I'd probably merge this fix and push out a hotfix for 1.2, since this bug makes TIC-80 crash on any JavaScript cart that uses a decimal number. Then, once the current version of TIC-80 is no longer crashing, we can have the discussion on whether we should update to the latest official QuickJS or swap to using QuickJS-NG instead. (Of course, while you're merging this fix, you should rebase on the latest QuickJS 2026-06-04, which fixes the CVEs the TIC-80 issue mentioned.) |
The previous implementation of
ctz32incorrectly used_BitScanForward,which can cause division by zero exception(Crash) in
js_atodwhen using likevar x = 3.0.Details:
in
js_atodctz32return wrong value making radix1 to be 0, which propagates tomul_powand causesl = (f + d - 1) / dwithd = 0.Then crash.