diff --git a/tests/ecmascript/test-bug-empty-finally-segfault-gh268.js b/tests/ecmascript/test-bug-empty-finally-segfault-gh268.js new file mode 100644 index 00000000..2b7dbe5d --- /dev/null +++ b/tests/ecmascript/test-bug-empty-finally-segfault-gh268.js @@ -0,0 +1,17 @@ +/* + * Try-catch regression in master, GH-268. + */ + +/*=== +still here +===*/ + +/* For the bug to be triggered, the function being compiled must not contain + * any constants and the try-finally must not have a catch clause. + */ +try { + eval('try {} finally {}'); +} catch (e) { + print(e.stack || e); +} +print('still here');