Bug 636818 - Crash [@ js::CallJSPropertyOpSetter] or [@ js_SetProperty]. r=gal, a=dmandelin.
☠☠ backed out by 7536e407b706 ☠ ☠
authorJason Orendorff <jorendorff@mozilla.com>
Wed, 02 Mar 2011 14:15:57 -0600
changeset 63289 25027d672f5019164b67995e181ff80c66e64b95
parent 63288 4f543b1fec65cccb9d0f6757726aa5b7ebb83f11
child 63290 8b3a403a6d26432f9da40bf9b6ff7c49455ed75c
push id19127
push userjorendorff@mozilla.com
push dateWed, 02 Mar 2011 21:29:14 +0000
treeherdermozilla-central@8b3a403a6d26 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgal, dmandelin
bugs636818
milestone2.0b13pre
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 636818 - Crash [@ js::CallJSPropertyOpSetter] or [@ js_SetProperty]. r=gal, a=dmandelin.
js/src/jsobj.cpp
js/src/jswrapper.cpp
js/src/tests/js1_8_5/extensions/jstests.list
js/src/tests/js1_8_5/extensions/regress-636818.js
security/manager/boot/public/nsISSLStatusProvider.idl
--- a/js/src/jsobj.cpp
+++ b/js/src/jsobj.cpp
@@ -5581,18 +5581,20 @@ js_SetPropertyHelper(JSContext *cx, JSOb
         return JS_FALSE;
     if (prop) {
         if (!pobj->isNative()) {
             if (pobj->isProxy()) {
                 AutoPropertyDescriptorRooter pd(cx);
                 if (!JSProxy::getPropertyDescriptor(cx, pobj, id, true, &pd))
                     return false;
 
-                if (pd.attrs & JSPROP_SHARED)
-                    return CallSetter(cx, obj, id, pd.setter, pd.attrs, pd.shortid, strict, vp);
+                if ((pd.attrs & (JSPROP_SHARED | JSPROP_SHADOWABLE)) == JSPROP_SHARED) {
+                    return !pd.setter ||
+                           CallSetter(cx, obj, id, pd.setter, pd.attrs, pd.shortid, strict, vp);
+                }
 
                 if (pd.attrs & JSPROP_READONLY) {
                     if (strict)
                         return obj->reportReadOnly(cx, id);
                     if (cx->hasStrictOption())
                         return obj->reportReadOnly(cx, id, JSREPORT_STRICT | JSREPORT_WARNING);
                     return true;
                 }
--- a/js/src/jswrapper.cpp
+++ b/js/src/jswrapper.cpp
@@ -107,17 +107,17 @@ JSWrapper::~JSWrapper()
 
 #define SET(action) CHECKED(action, SET)
 #define GET(action) CHECKED(action, GET)
 
 bool
 JSWrapper::getPropertyDescriptor(JSContext *cx, JSObject *wrapper, jsid id,
                                  bool set, PropertyDescriptor *desc)
 {
-    desc->obj= NULL; // default result if we refuse to perform this action
+    desc->obj = NULL; // default result if we refuse to perform this action
     CHECKED(JS_GetPropertyDescriptorById(cx, wrappedObject(wrapper), id, JSRESOLVE_QUALIFIED,
                                          Jsvalify(desc)), set ? SET : GET);
 }
 
 static bool
 GetOwnPropertyDescriptor(JSContext *cx, JSObject *obj, jsid id, uintN flags, JSPropertyDescriptor *desc)
 {
     if (!JS_GetPropertyDescriptorById(cx, obj, id, flags, desc))
--- a/js/src/tests/js1_8_5/extensions/jstests.list
+++ b/js/src/tests/js1_8_5/extensions/jstests.list
@@ -29,8 +29,9 @@ script regress-627984-1.js
 script regress-627984-2.js
 script regress-627984-3.js
 script regress-627984-4.js
 script regress-627984-5.js
 script regress-627984-6.js
 script regress-627984-7.js
 script regress-630377.js
 script regress-631723.js
+script regress-636818.js
new file mode 100644
--- /dev/null
+++ b/js/src/tests/js1_8_5/extensions/regress-636818.js
@@ -0,0 +1,8 @@
+// Any copyright is dedicated to the Public Domain.
+// http://creativecommons.org/licenses/publicdomain/
+
+a = evalcx('');
+a.__proto__ = ''.__proto__;
+a.length = 3;  // don't assert
+
+reportCompare(0, 0, 'ok');
deleted file mode 100644
--- a/security/manager/boot/public/nsISSLStatusProvider.idl
+++ /dev/null
@@ -1,44 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is mozilla.org code.
- *
- * The Initial Developer of the Original Code is
- * Netscape Communications Corporation.
- * Portions created by the Initial Developer are Copyright (C) 2001
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *   Terry Hayes <thayes@netscape.com>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-#include "nsISupports.idl"
-
-[scriptable, uuid(8de811f0-1dd2-11b2-8bf1-e9aa324984b2)]
-interface nsISSLStatusProvider : nsISupports {
-  readonly attribute nsISupports SSLStatus;
-};