Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 2e8a96a8c5857b071f073feea215c90803f22520
      
https://github.com/WebKit/WebKit/commit/2e8a96a8c5857b071f073feea215c90803f22520
  Author: Yusuke Suzuki <[email protected]>
  Date:   2026-08-07 (Fri, 07 Aug 2026)

  Changed paths:
    A JSTests/wasm/stress/memarg-offset-u64-encoding.js
    A JSTests/wasm/stress/unreachable-immediates-validation.js
    M Source/JavaScriptCore/wasm/WasmFunctionParser.h

  Log Message:
  -----------
  [JSC] Fix Wasm memory64 memarg offset parsing
https://bugs.webkit.org/show_bug.cgi?id=321328
rdar://184364662

Reviewed by Yijia Huang.

Regardless of memory64 / memory32, memarg offset is u64. This patch
fixes that by introducing `parseMemoryOffset`. We decode VarUInt64, and
then do range check for memory32 case. IPInt side is already using
VarUInt decoding so it does not need a change. Also we fix several Call,
Table related offset scanning in parseUnreachableExpression.

Tests: JSTests/wasm/stress/memarg-offset-u64-encoding.js
       JSTests/wasm/stress/unreachable-immediates-validation.js

* JSTests/wasm/stress/memarg-offset-u64-encoding.js: Added.
(leb):
(paddedLeb):
(section):
(moduleBytes):
(assertValid):
* JSTests/wasm/stress/unreachable-immediates-validation.js: Added.
(leb):
(section):
(moduleBytes):
* Source/JavaScriptCore/wasm/WasmFunctionParser.h:
(JSC::Wasm::FunctionParser<Context>::load):
(JSC::Wasm::FunctionParser<Context>::store):
(JSC::Wasm::FunctionParser<Context>::atomicLoad):
(JSC::Wasm::FunctionParser<Context>::atomicStore):
(JSC::Wasm::FunctionParser<Context>::atomicBinaryRMW):
(JSC::Wasm::FunctionParser<Context>::atomicCompareExchange):
(JSC::Wasm::FunctionParser<Context>::atomicWait):
(JSC::Wasm::FunctionParser<Context>::atomicNotify):
(JSC::Wasm::FunctionParser<Context>::simd):
(JSC::Wasm::FunctionParser<Context>::parseMemoryOffset):
(JSC::Wasm::FunctionParser<Context>::parseUnreachableExpression):

Canonical link: https://commits.webkit.org/318826@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to