Title: [107208] trunk/Source/WebCore
Revision
107208
Author
[email protected]
Date
2012-02-09 03:21:46 -0800 (Thu, 09 Feb 2012)

Log Message

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

Patch by Shinya Kawanaka <[email protected]> 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):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (107207 => 107208)


--- trunk/Source/WebCore/ChangeLog	2012-02-09 11:21:42 UTC (rev 107207)
+++ trunk/Source/WebCore/ChangeLog	2012-02-09 11:21:46 UTC (rev 107208)
@@ -1,3 +1,23 @@
+2012-02-09  Shinya Kawanaka  <[email protected]>
+
+        ASSERT_NO_EXCEPTION should be initialized with non-zero value.
+        https://bugs.webkit.org/show_bug.cgi?id=78194
+
+        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):
+
 2012-02-09  Roland Steiner  <[email protected]>
 
         Unreviewed, rolling out r107197.

Modified: trunk/Source/WebCore/dom/ExceptionCodePlaceholder.cpp (107207 => 107208)


--- trunk/Source/WebCore/dom/ExceptionCodePlaceholder.cpp	2012-02-09 11:21:42 UTC (rev 107207)
+++ trunk/Source/WebCore/dom/ExceptionCodePlaceholder.cpp	2012-02-09 11:21:46 UTC (rev 107208)
@@ -36,7 +36,7 @@
 #if !ASSERT_DISABLED
 
 NoExceptionAssertionChecker::NoExceptionAssertionChecker(const char* file, int line)
-    : ExceptionCodePlaceholder(0)
+    : ExceptionCodePlaceholder(defaultExceptionCode)
     , m_file(file)
     , m_line(line)
 {
@@ -44,7 +44,7 @@
 
 NoExceptionAssertionChecker::~NoExceptionAssertionChecker()
 {
-    ASSERT_AT(!m_code, m_file, m_line, "");
+    ASSERT_AT(!m_code || m_code == defaultExceptionCode, m_file, m_line, "");
 }
 
 #endif

Modified: trunk/Source/WebCore/dom/ExceptionCodePlaceholder.h (107207 => 107208)


--- trunk/Source/WebCore/dom/ExceptionCodePlaceholder.h	2012-02-09 11:21:42 UTC (rev 107207)
+++ trunk/Source/WebCore/dom/ExceptionCodePlaceholder.h	2012-02-09 11:21:46 UTC (rev 107208)
@@ -70,6 +70,7 @@
     ~NoExceptionAssertionChecker();
 
 private:
+    static const ExceptionCode defaultExceptionCode = 0xaaaaaaaa;
     const char* m_file;
     int m_line;
 };
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to