Skip to content

Commit 5df4976

Browse files
eqrionpchevrel@mozilla.com
authored andcommitted
Bug 1971581 - wasm: Align br_table limits with V8. a=pascalc
Original Revision: https://phabricator.services.mozilla.com/D253675 Differential Revision: https://phabricator.services.mozilla.com/D255141
1 parent 60dccfe commit 5df4976

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

js/src/jit-test/tests/asm.js/testControlFlow.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,11 +148,11 @@ var exp = asmLink(asmCompile(USE_ASM + "var x=0; function a() { return x|0 } fun
148148
assertEq(exp.c(10), undefined);
149149
assertEq(exp.a(), 10);
150150

151-
var f = asmLink(asmCompile(USE_ASM + "function f(i) { i=i|0; switch(i|0) { case 1: i=-1; break; case 133742: i=2; break; default: i=42; break } return i|0 } return f"));
151+
var f = asmLink(asmCompile(USE_ASM + "function f(i) { i=i|0; switch(i|0) { case 1: i=-1; break; case 65520: i=2; break; default: i=42; break } return i|0 } return f"));
152152
assertEq(f(1), -1);
153153
assertEq(f(2), 42);
154-
assertEq(f(133742), 2);
155-
assertEq(f(133743), 42);
154+
assertEq(f(65520), 2);
155+
assertEq(f(65521), 42);
156156

157157
var f = asmLink(asmCompile(USE_ASM + "function f(i) { i=i|0; switch(i|0) { case 1: i=42; break; default: i=13 } return i|0 } return f"));
158158
assertEq(f(-1), 13);

js/src/wasm/WasmConstants.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1181,7 +1181,7 @@ static_assert(uint64_t(MaxArrayPayloadBytes) <
11811181
// These limits pertain to our WebAssembly implementation only.
11821182

11831183
static const unsigned MaxTryTableCatches = 10000;
1184-
static const unsigned MaxBrTableElems = 1000000;
1184+
static const unsigned MaxBrTableElems = 65520;
11851185
static const unsigned MaxCodeSectionBytes = MaxModuleBytes;
11861186
static const unsigned MaxBranchHintValue = 2;
11871187

0 commit comments

Comments
 (0)