summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/wasm/regress/debug-clone-segment.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/jit-test/tests/wasm/regress/debug-clone-segment.js')
-rw-r--r--js/src/jit-test/tests/wasm/regress/debug-clone-segment.js36
1 files changed, 36 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/wasm/regress/debug-clone-segment.js b/js/src/jit-test/tests/wasm/regress/debug-clone-segment.js
new file mode 100644
index 0000000000..f91f62df32
--- /dev/null
+++ b/js/src/jit-test/tests/wasm/regress/debug-clone-segment.js
@@ -0,0 +1,36 @@
+// |jit-test| skip-if: !wasmDebuggingEnabled()
+//
+var mod = new WebAssembly.Module(wasmTextToBinary(`
+ (module
+ (func (export "func_0") (result i32)
+ call 0
+ )
+ )
+`));
+
+var g = newGlobal({newCompartment: true});
+g.parent = this;
+g.eval("(" + function() {
+ var dbg = Debugger(parent);
+ dbg.onEnterFrame = function(frame) {}
+} + ")()");
+
+processModule(mod);
+processModule(mod);
+processModule(mod);
+processModule(mod);
+
+mod = new WebAssembly.Module(wasmTextToBinary(`
+(module (export "func_0" (func $func1)) (func $func1))
+`));
+
+processModule(mod);
+processModule(mod);
+processModule(mod);
+processModule(mod);
+
+function processModule(module) {
+ try {
+ new WebAssembly.Instance(module).exports.func_0();
+ } catch(ex) {}
+}