Bug 1516567. Fix JSPropertySpec assertions to deal with not having a getter. r=jandem
authorBoris Zbarsky <bzbarsky@mit.edu>
Thu, 03 Jan 2019 16:52:59 +0000
changeset 509528 491828d457fc4889979775e8349f0acc978a5ce7
parent 509527 31756aa6f98d9de8ce01431c5b45e37e5c215880
child 509529 f5faf952c6d24e59b821018887e355f9af526bf0
push id10547
push userffxbld-merge
push dateMon, 21 Jan 2019 13:03:58 +0000
treeherdermozilla-beta@24ec1916bffe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjandem
bugs1516567
milestone66.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 1516567. Fix JSPropertySpec assertions to deal with not having a getter. r=jandem Differential Revision: https://phabricator.services.mozilla.com/D15423
js/src/jsapi.h
--- a/js/src/jsapi.h
+++ b/js/src/jsapi.h
@@ -1234,21 +1234,19 @@ struct JSPropertySpec {
   static_assert(offsetof(SelfHostedWrapper, funname) ==
                     offsetof(JSNativeWrapper, info),
                 "JS_SELF_HOSTED* macros below require that "
                 "SelfHostedWrapper::funname overlay "
                 "JSNativeWrapper::info");
 
  private:
   void checkAccessorsAreNative() const {
-    MOZ_ASSERT(accessors.getter.native.op);
-    // We may not have a setter at all.  So all we can assert here, for the
-    // native case is that if we have a jitinfo for the setter then we have
-    // a setter op too.  This is good enough to make sure we don't have a
-    // SelfHostedWrapper for the setter.
+    // We may have a getter or a setter or both.  And whichever ones we have
+    // should not have a SelfHostedWrapper for the accessor.
+    MOZ_ASSERT_IF(accessors.getter.native.info, accessors.getter.native.op);
     MOZ_ASSERT_IF(accessors.setter.native.info, accessors.setter.native.op);
   }
 
   void checkAccessorsAreSelfHosted() const {
     MOZ_ASSERT(!accessors.getter.selfHosted.unused);
     MOZ_ASSERT(!accessors.setter.selfHosted.unused);
   }
 };