Title: [214154] branches/safari-603-branch

Diff

Modified: branches/safari-603-branch/JSTests/ChangeLog (214153 => 214154)


--- branches/safari-603-branch/JSTests/ChangeLog	2017-03-20 01:32:04 UTC (rev 214153)
+++ branches/safari-603-branch/JSTests/ChangeLog	2017-03-20 01:32:07 UTC (rev 214154)
@@ -1,3 +1,17 @@
+2017-03-16  Jason Marcell  <jmarc...@apple.com>
+
+        Merge r213742. rdar://problem/30921818
+
+    2017-03-10  Mark Lam  <mark....@apple.com>
+
+            JSC: BindingNode::bindValue doesn't increase the scope's reference count.
+            https://bugs.webkit.org/show_bug.cgi?id=168546
+            <rdar://problem/30589551>
+
+            Reviewed by Saam Barati.
+
+            * stress/regress-168546.js: Added.
+
 2017-02-17  Matthew Hanson  <matthew_han...@apple.com>
 
         Merge r212177. rdar://problem/30205880

Added: branches/safari-603-branch/JSTests/stress/regress-168546.js (0 => 214154)


--- branches/safari-603-branch/JSTests/stress/regress-168546.js	                        (rev 0)
+++ branches/safari-603-branch/JSTests/stress/regress-168546.js	2017-03-20 01:32:07 UTC (rev 214154)
@@ -0,0 +1,14 @@
+// This test passes if it does not crash.
+try {
+    (function () {
+        let a = {
+            get val() {
+                [...{a = 1.45}] = [];
+                a.val.x;
+            },
+        };
+
+        a.val;
+    })();
+} catch (e) {
+}

Modified: branches/safari-603-branch/Source/_javascript_Core/ChangeLog (214153 => 214154)


--- branches/safari-603-branch/Source/_javascript_Core/ChangeLog	2017-03-20 01:32:04 UTC (rev 214153)
+++ branches/safari-603-branch/Source/_javascript_Core/ChangeLog	2017-03-20 01:32:07 UTC (rev 214154)
@@ -1,5 +1,24 @@
 2017-03-16  Jason Marcell  <jmarc...@apple.com>
 
+        Merge r213742. rdar://problem/30921818
+
+    2017-03-10  Mark Lam  <mark....@apple.com>
+
+            JSC: BindingNode::bindValue doesn't increase the scope's reference count.
+            https://bugs.webkit.org/show_bug.cgi?id=168546
+            <rdar://problem/30589551>
+
+            Reviewed by Saam Barati.
+
+            We should protect the scope RegisterID with a RefPtr while it is still needed.
+
+            * bytecompiler/NodesCodegen.cpp:
+            (JSC::ForInNode::emitLoopHeader):
+            (JSC::ForOfNode::emitBytecode):
+            (JSC::BindingNode::bindValue):
+
+2017-03-16  Jason Marcell  <jmarc...@apple.com>
+
         Merge r213648. rdar://problem/30921824
 
     2017-03-09  Filip Pizlo  <fpi...@apple.com>

Modified: branches/safari-603-branch/Source/_javascript_Core/bytecompiler/NodesCodegen.cpp (214153 => 214154)


--- branches/safari-603-branch/Source/_javascript_Core/bytecompiler/NodesCodegen.cpp	2017-03-20 01:32:04 UTC (rev 214153)
+++ branches/safari-603-branch/Source/_javascript_Core/bytecompiler/NodesCodegen.cpp	2017-03-20 01:32:07 UTC (rev 214154)
@@ -1,7 +1,7 @@
 /*
 *  Copyright (C) 1999-2002 Harri Porten (por...@kde.org)
 *  Copyright (C) 2001 Peter Kelly (p...@post.com)
-*  Copyright (C) 2003-2009, 2012-2013, 2015-2016 Apple Inc. All rights reserved.
+*  Copyright (C) 2003-2017 Apple Inc. All rights reserved.
 *  Copyright (C) 2007 Cameron Zwarich (cwzwar...@uwaterloo.ca)
 *  Copyright (C) 2007 Maks Orlovich
 *  Copyright (C) 2007 Eric Seidel <e...@webkit.org>
@@ -2689,9 +2689,9 @@
                 generator.emitExpressionInfo(divot(), divotStart(), divotEnd());
             if (var.isReadOnly())
                 generator.emitReadOnlyExceptionIfNeeded(var);
-            RegisterID* scope = generator.emitResolveScope(nullptr, var);
+            RefPtr<RegisterID> scope = generator.emitResolveScope(nullptr, var);
             generator.emitExpressionInfo(divot(), divotStart(), divotEnd());
-            generator.emitPutToScope(scope, var, propertyName, generator.isStrictMode() ? ThrowIfNotFound : DoNotThrowIfNotFound, InitializationMode::NotInitialization);
+            generator.emitPutToScope(scope.get(), var, propertyName, generator.isStrictMode() ? ThrowIfNotFound : DoNotThrowIfNotFound, InitializationMode::NotInitialization);
         }
         generator.emitProfileType(propertyName, var, m_lexpr->position(), JSTextPosition(-1, m_lexpr->position().offset + ident.length(), -1));
     };
@@ -2935,9 +2935,9 @@
                     generator.emitExpressionInfo(divot(), divotStart(), divotEnd());
                 if (var.isReadOnly())
                     generator.emitReadOnlyExceptionIfNeeded(var);
-                RegisterID* scope = generator.emitResolveScope(nullptr, var);
+                RefPtr<RegisterID> scope = generator.emitResolveScope(nullptr, var);
                 generator.emitExpressionInfo(divot(), divotStart(), divotEnd());
-                generator.emitPutToScope(scope, var, value, generator.isStrictMode() ? ThrowIfNotFound : DoNotThrowIfNotFound, InitializationMode::NotInitialization);
+                generator.emitPutToScope(scope.get(), var, value, generator.isStrictMode() ? ThrowIfNotFound : DoNotThrowIfNotFound, InitializationMode::NotInitialization);
             }
             generator.emitProfileType(value, var, m_lexpr->position(), JSTextPosition(-1, m_lexpr->position().offset + ident.length(), -1));
         } else if (m_lexpr->isDotAccessorNode()) {
@@ -4010,15 +4010,15 @@
     }
     if (generator.isStrictMode())
         generator.emitExpressionInfo(divotEnd(), divotStart(), divotEnd());
-    RegisterID* scope = generator.emitResolveScope(nullptr, var);
+    RefPtr<RegisterID> scope = generator.emitResolveScope(nullptr, var);
     generator.emitExpressionInfo(divotEnd(), divotStart(), divotEnd());
     if (m_bindingContext == AssignmentContext::AssignmentExpression)
-        generator.emitTDZCheckIfNecessary(var, nullptr, scope);
+        generator.emitTDZCheckIfNecessary(var, nullptr, scope.get());
     if (isReadOnly) {
         generator.emitReadOnlyExceptionIfNeeded(var);
         return;
     }
-    generator.emitPutToScope(scope, var, value, generator.isStrictMode() ? ThrowIfNotFound : DoNotThrowIfNotFound, initializationModeForAssignmentContext(m_bindingContext));
+    generator.emitPutToScope(scope.get(), var, value, generator.isStrictMode() ? ThrowIfNotFound : DoNotThrowIfNotFound, initializationModeForAssignmentContext(m_bindingContext));
     generator.emitProfileType(value, var, divotStart(), divotEnd());
     if (m_bindingContext == AssignmentContext::DeclarationStatement || m_bindingContext == AssignmentContext::ConstDeclarationStatement)
         generator.liftTDZCheckIfPossible(var);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to