HTMLElement.cpp does not compile with new clang
authorddkilzer@apple.com <ddkilzer@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 6 Sep 2014 15:02:58 +0000 (15:02 +0000)
committerddkilzer@apple.com <ddkilzer@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 6 Sep 2014 15:02:58 +0000 (15:02 +0000)
<http://webkit.org/b/136600>

Reviewed by Chris Fleizach.

Fixes the following static analyzer warning:

    Source/WebCore/html/HTMLElement.cpp:545:10: error: 'this' pointer cannot be null in well-defined C++ code; pointer may be assumed to always convert to true [-Werror,-Wundefined-bool-conversion]
        if (!this || !parentNode())
            ~^~~~

* html/HTMLElement.cpp:
(WebCore::HTMLElement::setOuterText): Remove "!this" check added
in r75738.  It would only cover up real bugs, and isn't even hit
in layout tests.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@173355 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/html/HTMLElement.cpp

index 4cd14cb..9b0ea0a 100644 (file)
@@ -1,3 +1,21 @@
+2014-09-06  David Kilzer  <ddkilzer@apple.com>
+
+        HTMLElement.cpp does not compile with new clang
+        <http://webkit.org/b/136600>
+
+        Reviewed by Chris Fleizach.
+
+        Fixes the following static analyzer warning:
+
+            Source/WebCore/html/HTMLElement.cpp:545:10: error: 'this' pointer cannot be null in well-defined C++ code; pointer may be assumed to always convert to true [-Werror,-Wundefined-bool-conversion]
+                if (!this || !parentNode())
+                    ~^~~~
+
+        * html/HTMLElement.cpp:
+        (WebCore::HTMLElement::setOuterText): Remove "!this" check added
+        in r75738.  It would only cover up real bugs, and isn't even hit
+        in layout tests.
+
 2014-09-06  Ryuan Choi  <ryuan.choi@gmail.com>
 
         [EFL] Drop evas object cursor support
index f5e52e9..a6d5758 100644 (file)
@@ -542,7 +542,7 @@ void HTMLElement::setOuterText(const String& text, ExceptionCode& ec)
     else
         newChild = Text::create(document(), text);
 
-    if (!this || !parentNode())
+    if (!parentNode())
         ec = HIERARCHY_REQUEST_ERR;
     if (ec)
         return;