Changeset 173326 in webkit for trunk/Source/JavaScriptCore/parser


Ignore:
Timestamp:
Sep 5, 2014, 12:33:29 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, JSObjectRef, JSScriptRef,
JSStringRef{CF} and JSValueRef.

Note that the following function arguments are _not_ NULL-checked
since doing so would just cover up bugs (and were not needed to
prevent any tests from failing):

  • |script| in JSEvaluateScript(), JSCheckScriptSyntax();
  • |body| in JSObjectMakeFunction();
  • |source| in JSScriptCreateReferencingImmortalASCIIText() (which is a const char* anyway);
  • |source| in JSScriptCreateFromString().
  • API/JSBase.cpp:

(JSEvaluateScript): Add NULL check for |sourceURL|.
(JSCheckScriptSyntax): Ditto.

  • API/JSObjectRef.cpp:

(JSObjectMakeFunction): Ditto.

  • API/JSScriptRef.cpp:

(JSScriptCreateReferencingImmortalASCIIText): Ditto.
(JSScriptCreateFromString): Add NULL check for |url|.

  • 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): Add NULL check for |string|.

  • 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/parser/SourceProvider.h

    r173263 r173326  
    5555        intptr_t asID()
    5656        {
    57             ASSERT(this);
    58             if (!this) // Be defensive in release mode.
    59                 return nullID;
    6057            if (!m_id)
    6158                getID();
Note: See TracChangeset for help on using the changeset viewer.