From 7f85ce13137dd86f29c1b058aa9357d11fbc038a Mon Sep 17 00:00:00 2001 From: Yune Choe <49iohcy@gmail.com> Date: Sat, 7 Mar 2026 13:54:03 +0000 Subject: [PATCH] Changes: Masking the low word to avoid checkInt32 from throwing when a num ge 4294967296 (u32 max + 1) is passed. --- src/lib/libint53.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/libint53.js b/src/lib/libint53.js index 40aca59384daa..f4cc5f3c5b227 100644 --- a/src/lib/libint53.js +++ b/src/lib/libint53.js @@ -19,7 +19,7 @@ addToLibrary({ // function $writeI53ToU64(): the implementation would be identical, and it is up to the // C/C++ side code to interpret the resulting number as signed or unsigned as is desirable. $writeI53ToI64: (ptr, num) => { - {{{ makeSetValue('ptr', 0, 'num', 'u32') }}}; + {{{ makeSetValue('ptr', 0, 'num&0xFFFFFFFF', 'u32') }}}; var lower = {{{ makeGetValue('ptr', 0, 'u32') }}}; {{{ makeSetValue('ptr', 4, '(num - lower)/4294967296', 'u32') }}}; #if ASSERTIONS