Ignore:
Timestamp:
Nov 30, 2012, 8:59:03 AM (13 years ago)
Author:
[email protected]
Message:

Crash in conversion of empty OpaqueJSString to Identifier
https://bugs.webkit.org/show_bug.cgi?id=101867

Reviewed by Michael Saboff.

The constructor call used for both null and empty OpaqueJSStrings results
in an assertion voilation and crash. This patch instead uses the Identifier
constructors which are specifically for null and empty Identifier.

  • API/OpaqueJSString.cpp:

(OpaqueJSString::identifier):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/API/OpaqueJSString.cpp

    r130931 r136246  
    5151Identifier OpaqueJSString::identifier(JSGlobalData* globalData) const
    5252{
    53     if (!this || !m_string.length())
    54         return Identifier(globalData, static_cast<const char*>(0));
     53    if (!this || m_string.isNull())
     54        return Identifier();
     55
     56    if (m_string.isEmpty())
     57        return Identifier(Identifier::EmptyIdentifier);
    5558
    5659    if (m_string.is8Bit())
Note: See TracChangeset for help on using the changeset viewer.