Skip to content

Commit

Permalink
fix load in sign and unsign
Browse files Browse the repository at this point in the history
Signed-off-by: Su Yihan <[email protected]>
  • Loading branch information
yviansu committed Dec 14, 2023
1 parent 34700ed commit f73fced
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/backend/binaryen/lib/init_builtin_api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4626,11 +4626,17 @@ function dataView_getInt16(module: binaryen.Module, isSigned: boolean) {
stmts.push(
module.local.set(
res_i32_idx,
module.i32.load16_s(
0,
2,
module.i32.const(BuiltinNames.memoryReserveOffset),
),
isSigned
? module.i32.load16_s(
0,
2,
module.i32.const(BuiltinNames.memoryReserveOffset),
)
: module.i32.load16_u(
0,
2,
module.i32.const(BuiltinNames.memoryReserveOffset),
),
),
);
stmts.push(
Expand Down

0 comments on commit f73fced

Please sign in to comment.