Bug 136591 - REGRESSION (r169407): Calls to RenderStyle::getRoundedBorderFor() in computeRoundedRectForBoxShape() still include RenderView pointer
Summary: REGRESSION (r169407): Calls to RenderStyle::getRoundedBorderFor() in computeR...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: David Kilzer (:ddkilzer)
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2014-09-05 16:44 PDT by David Kilzer (:ddkilzer)
Modified: 2014-09-06 17:46 PDT (History)
10 users (show)

See Also:


Attachments
Patch v1 (2.80 KB, patch)
2014-09-05 16:56 PDT, David Kilzer (:ddkilzer)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Kilzer (:ddkilzer) 2014-09-05 16:44:35 PDT
In <http://trac.webkit.org/r169407>, the RenderView pointer argument was removed from RenderStyle::getRoundedBorderFor(), but the code in computeRoundedRectForBoxShape() was never updated to remove the pointers.

Newer versions of clang now warn about taking the address of a reference value (and the fact that it will never be NULL):

Source/WebCore/rendering/shapes/BoxShape.cpp:74:117: error: reference cannot be bound to dereferenced null pointer in well-defined C++ code; pointer may be assumed to always convert to true [-Werror,-Wundefined-bool-conversion]
        RoundedRect::Radii radii = computeMarginBoxShapeRadii(style.getRoundedBorderFor(renderer.borderBoxRect(), &(renderer.view())).radii(), renderer);
                                                              ~~~~~                                                ~^~~~~~~~~~~~~~~~
In file included from Source/WebCore/rendering/shapes/BoxShape.cpp:33:
In file included from Source/WebCore/rendering/RenderBox.h:26:
In file included from Source/WebCore/rendering/RenderBoxModelObject.h:28:
In file included from Source/WebCore/rendering/RenderLayerModelObject.h:26:
In file included from Source/WebCore/rendering/RenderElement.h:27:
Source/WebCore/rendering/RenderObject.h:571:17: note: 'view' returns a reference
    RenderView& view() const { return *document().renderView(); };
                ^
Source/WebCore/rendering/shapes/BoxShape.cpp:90:70: error: reference cannot be bound to dereferenced null pointer in well-defined C++ code; pointer may be assumed to always convert to true [-Werror,-Wundefined-bool-conversion]
        return style.getRoundedBorderFor(renderer.borderBoxRect(), &(renderer.view()));
               ~~~~~                                                ~^~~~~~~~~~~~~~~~
In file included from Source/WebCore/rendering/shapes/BoxShape.cpp:33:
In file included from Source/WebCore/rendering/RenderBox.h:26:
In file included from Source/WebCore/rendering/RenderBoxModelObject.h:28:
In file included from Source/WebCore/rendering/RenderLayerModelObject.h:26:
In file included from Source/WebCore/rendering/RenderElement.h:27:
Source/WebCore/rendering/RenderObject.h:571:17: note: 'view' returns a reference
    RenderView& view() const { return *document().renderView(); };
                ^
Source/WebCore/rendering/shapes/BoxShape.cpp:94:66: error: reference cannot be bound to dereferenced null pointer in well-defined C++ code; pointer may be assumed to always convert to true [-Werror,-Wundefined-bool-conversion]
    return style.getRoundedBorderFor(renderer.borderBoxRect(), &(renderer.view()));
           ~~~~~                                                ~^~~~~~~~~~~~~~~~
In file included from Source/WebCore/rendering/shapes/BoxShape.cpp:33:
In file included from Source/WebCore/rendering/RenderBox.h:26:
In file included from Source/WebCore/rendering/RenderBoxModelObject.h:28:
In file included from Source/WebCore/rendering/RenderLayerModelObject.h:26:
In file included from Source/WebCore/rendering/RenderElement.h:27:
Source/WebCore/rendering/RenderObject.h:571:17: note: 'view' returns a reference
    RenderView& view() const { return *document().renderView(); };
                ^
3 errors generated.
Comment 1 David Kilzer (:ddkilzer) 2014-09-05 16:45:01 PDT
<rdar://problem/18143731>
Comment 2 David Kilzer (:ddkilzer) 2014-09-05 16:56:47 PDT
Created attachment 237724 [details]
Patch v1
Comment 3 WebKit Commit Bot 2014-09-05 19:24:27 PDT
Comment on attachment 237724 [details]
Patch v1

Clearing flags on attachment: 237724

Committed r173348: <http://trac.webkit.org/changeset/173348>
Comment 4 WebKit Commit Bot 2014-09-05 19:24:31 PDT
All reviewed patches have been landed.  Closing bug.
Comment 5 Darin Adler 2014-09-06 17:46:43 PDT
This just shows us how dangerous arguments of type bool are!