Ignore:
Timestamp:
Aug 12, 2011, 7:40:51 PM (14 years ago)
Author:
[email protected]
Message:

Use builtin_trap() for CRASH when building with clang
https://bugs.webkit.org/show_bug.cgi?id=66152

Reviewed by Anders Carlsson.

../JavaScriptCore:

  • wtf/Assertions.h:

Add Clang specific CRASH macro that calls builtin_trap() instead
of silly techniques to crash. This allows the static analyzer to understand
that we are intentionally crashing. As a result, we need to mark some functions
as not returning.

Also adds a macros that annotates a function as never returning due to ASSERT or CRASH.

  • wtf/Compiler.h:

Add COMPILIER(CLANG) and fix some formatting and spelling mistakes.

  • wtf/FastMalloc.cpp:

(WTF::Internal::fastMallocMatchFailed):
Add NO_RETURN_DUE_TO_CRASH.

  • yarr/YarrParser.h:

(JSC::Yarr::Parser::CharacterClassParserDelegate::assertionWordBoundary):
(JSC::Yarr::Parser::CharacterClassParserDelegate::atomBackReference):
Add NO_RETURN_DUE_TO_ASSERT.

../WebCore:

  • bindings/js/SerializedScriptValue.cpp:

(WebCore::CloneBase::fail):

  • bindings/objc/WebScriptObject.mm:
  • platform/mac/BlockExceptions.h:
  • platform/text/cf/StringImplCF.cpp:

Add NO_RETURN_DUE_TO_ASSERT.

  • bridge/IdentifierRep.h:

Don't define the destructor since it is never called,

../WebKit/mac:

  • Plugins/WebBaseNetscapePluginView.mm:

(-[WebBaseNetscapePluginView setAttributeKeys:andValues:]):
(-[WebBaseNetscapePluginView handleMouseMoved:]):
(-[WebBaseNetscapePluginView handleMouseEntered:]):
(-[WebBaseNetscapePluginView handleMouseExited:]):
(-[WebBaseNetscapePluginView focusChanged]):
(-[WebBaseNetscapePluginView windowFocusChanged:]):
(-[WebBaseNetscapePluginView createPlugin]):
(-[WebBaseNetscapePluginView loadStream]):
(-[WebBaseNetscapePluginView shouldStop]):
(-[WebBaseNetscapePluginView destroyPlugin]):
(-[WebBaseNetscapePluginView updateAndSetWindow]):
(-[WebBaseNetscapePluginView sendModifierEventWithKeyCode:character:]):
(-[WebBaseNetscapePluginView pluginLayer]):
(-[WebBaseNetscapePluginView getFormValue:]):
Remove the ASSERT_NOT_REACHED from the base class methods. They were not
adding much value and were getting in the way of making the static analyzer
work. A better way to do this would be to use a formal protocol.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/yarr/YarrParser.h

    r82988 r93012  
    212212        // parseEscape() should never call these delegate methods when
    213213        // invoked with inCharacterClass set.
    214         void assertionWordBoundary(bool) { ASSERT_NOT_REACHED(); }
    215         void atomBackReference(unsigned) { ASSERT_NOT_REACHED(); }
     214        NO_RETURN_DUE_TO_ASSERT void assertionWordBoundary(bool) { ASSERT_NOT_REACHED(); }
     215        NO_RETURN_DUE_TO_ASSERT void atomBackReference(unsigned) { ASSERT_NOT_REACHED(); }
    216216
    217217    private:
Note: See TracChangeset for help on using the changeset viewer.