Ignore:
Timestamp:
Sep 3, 2014, 5:53:16 PM (11 years ago)
Author:
[email protected]
Message:

JavaScriptCore should build with newer clang
<http://webkit.org/b/136002>
<rdar://problem/18020616>

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

Other than the JSC::SourceProvider::asID() change (which simply
removes code that the optimizing compiler would have discarded
in Release builds), we move the |this| checks in OpaqueJSString
to NULL checks in to JSBase, JSScriptRef, JSStringRef{CF} and
JSValueRef.

  • API/JSBase.cpp:

(JSEvaluateScript): Use String() in case |script| or |sourceURL|
are NULL.

  • API/JSScriptRef.cpp:

(JSScriptCreateReferencingImmortalASCIIText): Use String() in
case |url| is NULL.

  • API/JSStringRef.cpp:

(JSStringGetLength): Return early if NULL pointer is passed in.
(JSStringGetCharactersPtr): Ditto.
(JSStringGetUTF8CString): Ditto. Also check |buffer| parameter.

  • API/JSStringRefCF.cpp:

(JSStringCopyCFString): Ditto.

  • API/JSValueRef.cpp:

(JSValueMakeString): Use String() in case |string| is NULL.

  • API/OpaqueJSString.cpp:

(OpaqueJSString::string): Remove code that checks |this|.
(OpaqueJSString::identifier): Ditto.
(OpaqueJSString::characters): Ditto.

  • API/OpaqueJSString.h:

(OpaqueJSString::is8Bit): Remove code that checks |this|.
(OpaqueJSString::characters8): Ditto.
(OpaqueJSString::characters16): Ditto.
(OpaqueJSString::length): Ditto.

  • parser/SourceProvider.h:

(JSC::SourceProvider::asID): Remove code that checks |this|.

Source/WebKit2:

  • Shared/API/c/WKString.cpp:

(WKStringCreateWithJSString): Add NULL check to prevent
WebKitTestRunner crashes that relied on the previous |this|
behavior where NULL values were allowed.

File:
1 edited

Legend:

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

    r165719 r173245  
    5757String OpaqueJSString::string() const
    5858{
    59     if (!this)
    60         return String();
    61 
    6259    // Return a copy of the wrapped string, because the caller may make it an Identifier.
    6360    return m_string.isolatedCopy();
     
    6663Identifier OpaqueJSString::identifier(VM* vm) const
    6764{
    68     if (!this || m_string.isNull())
     65    if (m_string.isNull())
    6966        return Identifier();
    7067
     
    8077const UChar* OpaqueJSString::characters()
    8178{
    82     if (!this)
    83         return nullptr;
    84 
    8579    // m_characters is put in a local here to avoid an extra atomic load.
    8680    UChar* characters = m_characters;
Note: See TracChangeset for help on using the changeset viewer.