Bug 1147662: LexicalCheck should be a guard, so as not to be removed; r=shu
authorBenjamin Bouvier <benj@benj.me>
Thu, 26 Mar 2015 12:59:26 +0100
changeset 266418 46e3f17440a755eef4feb276f779d4d11f771f96
parent 266417 8c45833b771aff8f8338e423af21ab03420799da
child 266419 366c8ef076488ed6fe2f158d4a65d47bb7013153
push id830
push userraliiev@mozilla.com
push dateFri, 19 Jun 2015 19:24:37 +0000
treeherdermozilla-release@932614382a68 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersshu
bugs1147662
milestone39.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1147662: LexicalCheck should be a guard, so as not to be removed; r=shu
js/src/jit-test/tests/ion/lexical-check-4.js
js/src/jit/MIR.h
new file mode 100644
--- /dev/null
+++ b/js/src/jit-test/tests/ion/lexical-check-4.js
@@ -0,0 +1,15 @@
+var caught = false;
+try {
+    (function() {
+        let x = (function f(y) {
+            if (y == 0) {
+                x
+                return
+            }
+            return f(y - 1)
+        })(3)
+    })()
+} catch(e) {
+    caught = true;
+}
+assertEq(caught, true);
--- a/js/src/jit/MIR.h
+++ b/js/src/jit/MIR.h
@@ -7048,16 +7048,17 @@ class MLexicalCheck
     public BoxPolicy<0>::Data
 {
     explicit MLexicalCheck(MDefinition *input)
       : MUnaryInstruction(input)
     {
         setResultType(MIRType_Value);
         setResultTypeSet(input->resultTypeSet());
         setMovable();
+        setGuard();
     }
 
   public:
     INSTRUCTION_HEADER(LexicalCheck)
 
     static MLexicalCheck *New(TempAllocator &alloc, MDefinition *input) {
         return new(alloc) MLexicalCheck(input);
     }