Changeset 204261 in webkit


Ignore:
Timestamp:
Aug 8, 2016 11:56:54 AM (8 years ago)
Author:
mark.lam@apple.com
Message:

ASSERTION FAILED: hasInlineStorage() in JSFinalObject::visitChildren().
https://bugs.webkit.org/show_bug.cgi?id=160666

Reviewed by Keith Miller.

JSTests:

  • stress/object-constructor-should-be-new-target-aware.js:

Source/JavaScriptCore:

This assertion is benign. JSFinalObject::visitChildren() calls
JSObject::inlineStorage() to get a pointer to the object's inline storage, and
later passes it to visitor.appendValuesHidden() with a previously computed
storageSize. When storageSize is 0, appendValuesHidden() ends up doing nothing.
However, before we get there, JSObject::inlineStorage() will be asserting
hasInlineStorage() and this assertion will fail when storageSize is 0.

We can fix this assertion failure by simply adding a storageSize check before
calling hasInlineStorage() and visitor.appendValuesHidden().

  • runtime/JSObject.cpp:

(JSC::JSFinalObject::visitChildren):

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/JSTests/ChangeLog

    r204248 r204261  
     12016-08-08  Mark Lam  <mark.lam@apple.com>
     2
     3        ASSERTION FAILED: hasInlineStorage() in JSFinalObject::visitChildren().
     4        https://bugs.webkit.org/show_bug.cgi?id=160666
     5
     6        Reviewed by Keith Miller.
     7
     8        * stress/object-constructor-should-be-new-target-aware.js:
     9
    1102016-08-07  Yusuke Suzuki  <utatane.tea@gmail.com>
    211
  • trunk/JSTests/stress/object-constructor-should-be-new-target-aware.js

    r200421 r204261  
    1515
    1616shouldBe(Reflect.construct(Object, [], Hello).__proto__, Hello.prototype);
     17
     18gc(); // Regression test for https:/webkit.org/b/160666.
  • trunk/Source/JavaScriptCore/ChangeLog

    r204255 r204261  
     12016-08-08  Mark Lam  <mark.lam@apple.com>
     2
     3        ASSERTION FAILED: hasInlineStorage() in JSFinalObject::visitChildren().
     4        https://bugs.webkit.org/show_bug.cgi?id=160666
     5
     6        Reviewed by Keith Miller.
     7
     8        This assertion is benign.  JSFinalObject::visitChildren() calls
     9        JSObject::inlineStorage() to get a pointer to the object's inline storage, and
     10        later passes it to visitor.appendValuesHidden() with a previously computed
     11        storageSize.  When storageSize is 0, appendValuesHidden() ends up doing nothing.
     12        However, before we get there, JSObject::inlineStorage() will be asserting
     13        hasInlineStorage() and this assertion will fail when storageSize is 0.
     14
     15        We can fix this assertion failure by simply adding a storageSize check before
     16        calling hasInlineStorage() and visitor.appendValuesHidden().
     17
     18        * runtime/JSObject.cpp:
     19        (JSC::JSFinalObject::visitChildren):
     20
    1212016-08-08  Brian Burg  <bburg@apple.com>
    222
  • trunk/Source/JavaScriptCore/runtime/JSObject.cpp

    r203368 r204261  
    294294
    295295    size_t storageSize = structure->inlineSize();
    296     visitor.appendValuesHidden(thisObject->inlineStorage(), storageSize);
     296    if (storageSize)
     297        visitor.appendValuesHidden(thisObject->inlineStorage(), storageSize);
    297298
    298299#if !ASSERT_DISABLED
Note: See TracChangeset for help on using the changeset viewer.