Changeset 107208 in webkit


Ignore:
Timestamp:
Feb 9, 2012 3:21:46 AM (12 years ago)
Author:
commit-queue@webkit.org
Message:

ASSERT_NO_EXCEPTION should be initialized with non-zero value.
https://bugs.webkit.org/show_bug.cgi?id=78194

Patch by Shinya Kawanaka <shinyak@google.com> on 2012-02-09
Reviewed by Hajime Morita.

ExceptionCode should not be checked without initializing it.
However, we encountered a bug that breaks this rule.
It was missed until now because ExceptionCode is sometimes set to 0 even if it is not initialized.
This patch ensures it is initialized as non-zero value.

No new tests, no change in behavior.

  • dom/ExceptionCodePlaceholder.cpp:

(WebCore::NoExceptionAssertionChecker::NoExceptionAssertionChecker):
(WebCore::NoExceptionAssertionChecker::~NoExceptionAssertionChecker):

  • dom/ExceptionCodePlaceholder.h:

(NoExceptionAssertionChecker):

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r107205 r107208  
     12012-02-09  Shinya Kawanaka  <shinyak@google.com>
     2
     3        ASSERT_NO_EXCEPTION should be initialized with non-zero value.
     4        https://bugs.webkit.org/show_bug.cgi?id=78194
     5
     6        Reviewed by Hajime Morita.
     7
     8        ExceptionCode should not be checked without initializing it.
     9        However, we encountered a bug that breaks this rule.
     10        It was missed until now because ExceptionCode is sometimes set to 0 even if it is not initialized.
     11        This patch ensures it is initialized as non-zero value.
     12
     13        No new tests, no change in behavior.
     14
     15        * dom/ExceptionCodePlaceholder.cpp:
     16        (WebCore::NoExceptionAssertionChecker::NoExceptionAssertionChecker):
     17        (WebCore::NoExceptionAssertionChecker::~NoExceptionAssertionChecker):
     18        * dom/ExceptionCodePlaceholder.h:
     19        (NoExceptionAssertionChecker):
     20
    1212012-02-09  Roland Steiner  <rolandsteiner@chromium.org>
    222
  • trunk/Source/WebCore/dom/ExceptionCodePlaceholder.cpp

    r95901 r107208  
    3737
    3838NoExceptionAssertionChecker::NoExceptionAssertionChecker(const char* file, int line)
    39     : ExceptionCodePlaceholder(0)
     39    : ExceptionCodePlaceholder(defaultExceptionCode)
    4040    , m_file(file)
    4141    , m_line(line)
     
    4545NoExceptionAssertionChecker::~NoExceptionAssertionChecker()
    4646{
    47     ASSERT_AT(!m_code, m_file, m_line, "");
     47    ASSERT_AT(!m_code || m_code == defaultExceptionCode, m_file, m_line, "");
    4848}
    4949
  • trunk/Source/WebCore/dom/ExceptionCodePlaceholder.h

    r95901 r107208  
    7171
    7272private:
     73    static const ExceptionCode defaultExceptionCode = 0xaaaaaaaa;
    7374    const char* m_file;
    7475    int m_line;
Note: See TracChangeset for help on using the changeset viewer.