Summary: | -Wnonnull warning in JITCall.cpp | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Michael Catanzaro <mcatanzaro> | ||||
Component: | JavaScriptCore | Assignee: | Michael Catanzaro <mcatanzaro> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | aperez, darin, ews-watchlist, keith_miller, mark.lam, mcatanzaro, msaboff, saam, tzagallo, webkit-bug-importer, ysuzuki | ||||
Priority: | P2 | Keywords: | InRadar | ||||
Version: | WebKit Nightly Build | ||||||
Hardware: | PC | ||||||
OS: | Linux | ||||||
See Also: | https://bugs.webkit.org/show_bug.cgi?id=226193 | ||||||
Bug Depends on: | |||||||
Bug Blocks: | 155047 | ||||||
Attachments: |
|
Description
Michael Catanzaro
2021-06-04 07:29:32 PDT
GCC's warning looks wrong. it is nullptr only when opcodeID is op_call_eval. And these cases are handled in if (compileCallEval(bytecode)) return; So, L256, it must be a non nullptr. My intuition is that GCC's implementation of this warning looks broken :( Did we found a real bug with this warning so far? (In reply to Yusuke Suzuki from comment #2) > Did we found a real bug with this warning so far? Yes, that's what the IGNORE_ERRONEOUS_GCC_NULL_CHECK_WARNINGS_BEGIN macro is for. The GCC developers are going to say it's not a bug because the warning is not intended to avoid all possible false-positives, so let's use IGNORE_ERRONEOUS_GCC_NULL_CHECK_WARNINGS_BEGIN. Created attachment 431254 [details]
Patch
(Alternatively: we could use -Wno-nonnull globally when building with GCC, and rely on developers building with Clang to catch real -Wnonnull problems.) I think it's few enough cases so far that the macro is OK for now, but they are unfortunately in some awkward places (e.g. RefPtr.h): $ git grep IGNORE_ERRONEOUS WTF/wtf/Compiler.h:#define IGNORE_ERRONEOUS_GCC_NULL_CHECK_WARNINGS_BEGIN IGNORE_GCC_WARNINGS_BEGIN("nonnull") WTF/wtf/Compiler.h:#define IGNORE_ERRONEOUS_GCC_NULL_CHECK_WARNINGS_END IGNORE_GCC_WARNINGS_END WTF/wtf/RefPtr.h:IGNORE_ERRONEOUS_GCC_NULL_CHECK_WARNINGS_BEGIN WTF/wtf/RefPtr.h:IGNORE_ERRONEOUS_GCC_NULL_CHECK_WARNINGS_END WebCore/css/CSSValue.h:IGNORE_ERRONEOUS_GCC_NULL_CHECK_WARNINGS_BEGIN WebCore/css/CSSValue.h:IGNORE_ERRONEOUS_GCC_NULL_CHECK_WARNINGS_END WebCore/css/StyleRule.h:IGNORE_ERRONEOUS_GCC_NULL_CHECK_WARNINGS_BEGIN WebCore/css/StyleRule.h:IGNORE_ERRONEOUS_GCC_NULL_CHECK_WARNINGS_END WebCore/dom/Node.h:IGNORE_ERRONEOUS_GCC_NULL_CHECK_WARNINGS_BEGIN WebCore/dom/Node.h:IGNORE_ERRONEOUS_GCC_NULL_CHECK_WARNINGS_END WebKit/WebProcess/Plugins/PluginView.cpp:IGNORE_ERRONEOUS_GCC_NULL_CHECK_WARNINGS_BEGIN WebKit/WebProcess/Plugins/PluginView.cpp:IGNORE_ERRONEOUS_GCC_NULL_CHECK_WARNINGS_END (In reply to Michael Catanzaro from comment #3) > The GCC developers are going to say it's not a bug because the warning is > not intended to avoid all possible false-positives, so let's use > IGNORE_ERRONEOUS_GCC_NULL_CHECK_WARNINGS_BEGIN. Reference for this: https://bugzilla.redhat.com/show_bug.cgi?id=1948775#c4 Committed r278816 (238769@main): <https://commits.webkit.org/238769@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 431254 [details]. |