Changeset 177995 in webkit


Ignore:
Timestamp:
Jan 6, 2015 2:24:15 PM (9 years ago)
Author:
ap@apple.com
Message:

ADDRESS_SANITIZER macro is overloaded
https://bugs.webkit.org/show_bug.cgi?id=140130

Reviewed by Anders Carlsson.

Source/JavaScriptCore:

  • interpreter/JSStack.cpp: (JSC::JSStack::sanitizeStack): Use the new macro.

This code is nearly unused (only compiled in when JIT is disabled at build time),
however I've been told that it's best to keep it.

Source/WebCore:

  • platform/RefCountedSupplement.h:
  • platform/Supplementable.h:

Change the conditional to ENABLE(SECURITY_ASSERTIONS). These checks will be used
in debug builds, and also when one explicitly passes -DENABLE_SECURITY_ASSERTIONS.

Source/WTF:

  • wtf/Compiler.h: Added an ASAN_ENABLED macro. The abbreviation should become well

known - we already use it in tools.

  • wtf/Assertions.h:
  • wtf/RefCounted.h:
  • wtf/SizeLimits.cpp:

Change the conditional to ENABLE(SECURITY_ASSERTIONS). These checks will be used
in debug builds, and also when one explicitly passes -DENABLE_SECURITY_ASSERTIONS.

Tools:

  • WebKitTestRunner/TestController.cpp: Use the new macro.
Location:
trunk
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r177994 r177995  
     12015-01-06  Alexey Proskuryakov  <ap@apple.com>
     2
     3        ADDRESS_SANITIZER macro is overloaded
     4        https://bugs.webkit.org/show_bug.cgi?id=140130
     5
     6        Reviewed by Anders Carlsson.
     7
     8        * interpreter/JSStack.cpp: (JSC::JSStack::sanitizeStack): Use the new macro.
     9        This code is nearly unused (only compiled in when JIT is disabled at build time),
     10        however I've been told that it's best to keep it.
     11
    1122015-01-06  Mark Lam  <mark.lam@apple.com>
    213
  • trunk/Source/JavaScriptCore/interpreter/JSStack.cpp

    r170147 r177995  
    119119void JSStack::sanitizeStack()
    120120{
    121 #if !defined(ADDRESS_SANITIZER)
     121#if !ASAN_ENABLED
    122122    ASSERT(topOfStack() <= baseOfStack());
    123123   
  • trunk/Source/WTF/ChangeLog

    r177929 r177995  
     12015-01-06  Alexey Proskuryakov  <ap@apple.com>
     2
     3        ADDRESS_SANITIZER macro is overloaded
     4        https://bugs.webkit.org/show_bug.cgi?id=140130
     5
     6        Reviewed by Anders Carlsson.
     7
     8        * wtf/Compiler.h: Added an ASAN_ENABLED macro. The abbreviation should become well
     9        known - we already use it in tools.
     10
     11        * wtf/Assertions.h:
     12        * wtf/RefCounted.h:
     13        * wtf/SizeLimits.cpp:
     14        Change the conditional to ENABLE(SECURITY_ASSERTIONS). These checks will be used
     15        in debug builds, and also when one explicitly passes -DENABLE_SECURITY_ASSERTIONS.
     16
    1172015-01-05  Andreas Kling  <akling@apple.com>
    218
  • trunk/Source/WTF/wtf/Assertions.h

    r174898 r177995  
    214214#define ASSERT_UNUSED(variable, assertion) ((void)variable)
    215215
    216 #ifdef ADDRESS_SANITIZER
     216#if ENABLE(SECURITY_ASSERTIONS)
    217217#define ASSERT_WITH_SECURITY_IMPLICATION(assertion) \
    218218    (!(assertion) ? \
  • trunk/Source/WTF/wtf/Compiler.h

    r177729 r177995  
    137137#endif
    138138
     139#if defined(__has_feature)
     140#define ASAN_ENABLED __has_feature(address_sanitizer)
     141#else
     142#define ASAN_ENABLED false
     143#endif
     144
    139145/* ==== Compiler-independent macros for various compiler features, in alphabetical order ==== */
    140146
  • trunk/Source/WTF/wtf/RefCounted.h

    r175382 r177995  
    2828namespace WTF {
    2929
    30 #if defined(NDEBUG) && !defined(ADDRESS_SANITIZER)
     30#if defined(NDEBUG) && !ENABLE(SECURITY_ASSERTIONS)
    3131#define CHECK_REF_COUNTED_LIFECYCLE 0
    3232#else
  • trunk/Source/WTF/wtf/SizeLimits.cpp

    r175424 r177995  
    4242namespace WTF {
    4343
    44 #if !defined(NDEBUG) || defined(ADDRESS_SANITIZER)
     44#if !defined(NDEBUG) || ENABLE(SECURITY_ASSERTIONS)
    4545struct SameSizeAsRefCounted {
    4646    int a;
  • trunk/Source/WebCore/ChangeLog

    r177993 r177995  
     12015-01-06  Alexey Proskuryakov  <ap@apple.com>
     2
     3        ADDRESS_SANITIZER macro is overloaded
     4        https://bugs.webkit.org/show_bug.cgi?id=140130
     5
     6        Reviewed by Anders Carlsson.
     7
     8        * platform/RefCountedSupplement.h:
     9        * platform/Supplementable.h:
     10        Change the conditional to ENABLE(SECURITY_ASSERTIONS). These checks will be used
     11        in debug builds, and also when one explicitly passes -DENABLE_SECURITY_ASSERTIONS.
     12
    1132015-01-06  Brian J. Burg  <burg@cs.washington.edu>
    214
  • trunk/Source/WebCore/platform/RefCountedSupplement.h

    r162139 r177995  
    4545        explicit Wrapper(PassRefPtr<ThisType> wrapped) : m_wrapped(wrapped) { }
    4646        virtual ~Wrapper() { m_wrapped->hostDestroyed();  }
    47 #if !ASSERT_DISABLED || defined(ADDRESS_SANITIZER)
     47#if !ASSERT_DISABLED || ENABLE(SECURITY_ASSERTIONS)
    4848        virtual bool isRefCountedWrapper() const override { return true; }
    4949#endif
  • trunk/Source/WebCore/platform/Supplementable.h

    r174723 r177995  
    8080public:
    8181    virtual ~Supplement() { }
    82 #if !ASSERT_DISABLED || defined(ADDRESS_SANITIZER)
     82#if !ASSERT_DISABLED || ENABLE(SECURITY_ASSERTIONS)
    8383    virtual bool isRefCountedWrapper() const { return false; }
    8484#endif
  • trunk/Tools/ChangeLog

    r177949 r177995  
     12015-01-06  Alexey Proskuryakov  <ap@apple.com>
     2
     3        ADDRESS_SANITIZER macro is overloaded
     4        https://bugs.webkit.org/show_bug.cgi?id=140130
     5
     6        Reviewed by Anders Carlsson.
     7
     8        * WebKitTestRunner/TestController.cpp: Use the new macro.
     9
    1102015-01-05  Joseph Pecoraro  <pecoraro@apple.com>
    211
  • trunk/Tools/WebKitTestRunner/TestController.cpp

    r177930 r177995  
    7171const unsigned TestController::w3cSVGViewHeight = 360;
    7272
    73 #if defined(__has_feature)
    74 #if __has_feature(address_sanitizer)
     73#if ASAN_ENABLED
    7574const double TestController::shortTimeout = 10.0;
    76 #else
    77 const double TestController::shortTimeout = 5.0;
    78 #endif
    7975#else
    8076const double TestController::shortTimeout = 5.0;
Note: See TracChangeset for help on using the changeset viewer.