diff --git a/js/src/jit-test/tests/ion/bug912152.js b/js/src/jit-test/tests/ion/bug912152.js new file mode 100644 index 00000000000..4c429fa46a2 --- /dev/null +++ b/js/src/jit-test/tests/ion/bug912152.js @@ -0,0 +1,7 @@ + +function foo() { + try { + this.f = 0; + } finally {} +} +new foo(); diff --git a/js/src/jit/Ion.cpp b/js/src/jit/Ion.cpp index 19c75358e3e..9f2c5f9f54d 100644 --- a/js/src/jit/Ion.cpp +++ b/js/src/jit/Ion.cpp @@ -1599,12 +1599,6 @@ IonCompile(JSContext *cx, JSScript *script, if (!script->ensureRanAnalysis(cx)) return AbortReason_Alloc; - // Try-finally is not yet supported. - if (script->analysis()->hasTryFinally()) { - IonSpew(IonSpew_Abort, "Has try-finally."); - return AbortReason_Disable; - } - LifoAlloc *alloc = cx->new_(BUILDER_LIFO_ALLOC_PRIMARY_CHUNK_SIZE); if (!alloc) return AbortReason_Alloc; diff --git a/js/src/jit/IonBuilder.cpp b/js/src/jit/IonBuilder.cpp index f5a097f9bd3..eb94aa8070b 100644 --- a/js/src/jit/IonBuilder.cpp +++ b/js/src/jit/IonBuilder.cpp @@ -3364,7 +3364,8 @@ IonBuilder::jsop_try() return abort("Try-catch support disabled"); // Try-finally is not yet supported. - JS_ASSERT(!script()->analysis()->hasTryFinally()); + if (script()->analysis()->hasTryFinally()) + return abort("Has try-finally"); graph().setHasTryBlock();