WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
165987
warning: the compiler can assume that the address of ‘thisObject’ will always evaluate to ‘true’ [-Waddress] in WebCore::JSHTMLDocument::getOwnPropertySlot
https://bugs.webkit.org/show_bug.cgi?id=165987
Summary
warning: the compiler can assume that the address of ‘thisObject’ will always...
Michael Catanzaro
Reported
2016-12-16 20:17:19 PST
Seems ASSERT_GC_OBJECT_LOOKS_VALID is causing a warning again (like in
r194303
). Ways to fix this: * Use ASSERT_THIS_GC_OBJECT_INHERITS instead of ASSERT_GC_OBJECT_INHERITS. The only difference is ASSERT_THIS_GC_OBJECT_INHERITS doesn't have the null check that triggers the warning, so the behavior is what we want, but it'd be evil because here we are checking |thisObject| which is a normal parameter, not |this|. * Add more macros that do the same thing, with different names. * Just pass the original pointer rather than taking the address of a reference. If this starts happening in more cases we should probably go with the second option, but the last option seems cleanest for now. [1244/4409] Building CXX object Source...bindings/js/JSHTMLDocumentCustom.cpp.o In file included from ../../Source/WTF/wtf/StdLibExtras.h:33:0, from ../../Source/WTF/wtf/FastMalloc.h:26, from ../../Source/WebCore/config.h:75, from ../../Source/WebCore/bindings/js/JSHTMLDocumentCustom.cpp:26: ../../Source/WebCore/bindings/js/JSHTMLDocumentCustom.cpp: In static member function ‘static bool WebCore::JSHTMLDocument::getOwnPropertySlot(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, JSC::PropertySlot&)’: ../../Source/WTF/wtf/Assertions.h:283:20: warning: the compiler can assume that the address of ‘thisObject’ will always evaluate to ‘true’ [-Waddress] if (!(assertion)) { \ ^ ../../Source/WTF/wtf/Assertions.h:437:35: note: in expansion of macro ‘ASSERT’ #define RELEASE_ASSERT(assertion) ASSERT(assertion) ^~~~~~ ../../Source/JavaScriptCore/heap/GCAssertions.h:34:5: note: in expansion of macro ‘RELEASE_ASSERT’ RELEASE_ASSERT(cell);\ ^~~~~~~~~~~~~~ ../../Source/JavaScriptCore/heap/GCAssertions.h:39:5: note: in expansion of macro ‘ASSERT_GC_OBJECT_LOOKS_VALID’ ASSERT_GC_OBJECT_LOOKS_VALID(object); \ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../../Source/WebCore/bindings/js/JSHTMLDocumentCustom.cpp:58:5: note: in expansion of macro ‘ASSERT_GC_OBJECT_INHERITS’ ASSERT_GC_OBJECT_INHERITS((&thisObject), info()); ^ ../../Source/WTF/wtf/Assertions.h:283:20: warning: the compiler can assume that the address of ‘thisObject’ will always evaluate to ‘true’ [-Waddress] if (!(assertion)) { \ ^ ../../Source/WTF/wtf/Assertions.h:437:35: note: in expansion of macro ‘ASSERT’ #define RELEASE_ASSERT(assertion) ASSERT(assertion) ^~~~~~ ../../Source/JavaScriptCore/heap/GCAssertions.h:34:5: note: in expansion of macro ‘RELEASE_ASSERT’ RELEASE_ASSERT(cell);\ ^~~~~~~~~~~~~~ ../../Source/JavaScriptCore/heap/GCAssertions.h:39:5: note: in expansion of macro ‘ASSERT_GC_OBJECT_LOOKS_VALID’ ASSERT_GC_OBJECT_LOOKS_VALID(object); \ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../../Source/WebCore/bindings/js/JSHTMLDocumentCustom.cpp:58:5: note: in expansion of macro ‘ASSERT_GC_OBJECT_INHERITS’ ASSERT_GC_OBJECT_INHERITS((&thisObject), info()); ^
Attachments
Patch
(1.87 KB, patch)
2016-12-17 07:00 PST
,
Michael Catanzaro
mark.lam
: review+
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Michael Catanzaro
Comment 1
2016-12-17 07:00:01 PST
Created
attachment 297404
[details]
Patch
Mark Lam
Comment 2
2016-12-17 08:45:53 PST
Comment on
attachment 297404
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=297404&action=review
r=me
> Source/WebCore/ChangeLog:3 > + warning: the compiler can assume that the address of âthisObjectâ will always evaluate to âtrueâ [-Waddress] in WebCore::JSHTMLDocument::getOwnPropertySlot
please fix non-ascii chars.
Michael Catanzaro
Comment 3
2016-12-17 10:14:12 PST
Committed
r209965
: <
http://trac.webkit.org/changeset/209965
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug