Bug 1502886 - Test. r=jonco, a=RyanVM
authorBenjamin Bouvier <benj@benj.me>
Tue, 30 Oct 2018 14:07:25 +0100
changeset 501090 12500028fe79390ae7d2d4128acf92d2c0d18733
parent 501089 f65ddbf6c00545fcf8f56df06ee2a7e3811e5faf
child 501091 50bb4e6c8ab511f9103f8ddc8d0044ef49c31318
push id1864
push userffxbld-merge
push dateMon, 03 Dec 2018 15:51:40 +0000
treeherdermozilla-release@f040763d99ad [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjonco, RyanVM
bugs1502886
milestone64.0
Bug 1502886 - Test. r=jonco, a=RyanVM
js/src/jit-test/tests/wasm/regress/bug1502886.js
new file mode 100644
--- /dev/null
+++ b/js/src/jit-test/tests/wasm/regress/bug1502886.js
@@ -0,0 +1,35 @@
+newGlobal();
+g = newGlobal();
+var dbg = Debugger(g);
+gczeal(2, 100);
+function f(x, initFunc) {
+    newGlobal();
+    g.eval(`
+        var {
+            binary,
+            offsets
+        } = wasmTextToBinary('${x}', true);
+        new WebAssembly.Instance(new WebAssembly.Module(binary));
+    `);
+    var {
+        offsets
+    } = g;
+    var wasmScript = dbg.findScripts().filter(s => s.format == 'wasm')[0];
+    initFunc({
+        wasmScript,
+        breakpoints: offsets
+    })
+};
+try {
+    f('(module (funcnopnop)(export "" 0))',
+        function({
+            wasmScript,
+            breakpoints
+        }) {
+            breakpoints.forEach(function(offset) {
+                wasmScript.setBreakpoint(offset, s = {});
+            });
+        }
+    );
+    f();
+} catch (e) {}