Bug 224826

Summary: Static asserts in WasmAirIRGenerator.cpp and WasmB3IRGenerator.cpp trigger -Wnonnull warnings with GCC 11
Product: WebKit Reporter: Michael Catanzaro <mcatanzaro>
Component: JavaScriptCoreAssignee: Michael Catanzaro <mcatanzaro>
Status: RESOLVED FIXED    
Severity: Normal CC: 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=224452
Attachments:
Description Flags
Patch none

Description Michael Catanzaro 2021-04-20 12:54:36 PDT
These asserts are understandably triggering -Wnonnull warnings:

static_assert(sizeof(decltype(static_cast<Instance*>(nullptr)->cachedStackLimit())) == sizeof(uint64_t), "");

In https://bugs.webkit.org/show_bug.cgi?id=224452#c26, Jonathan Wakely has a tip to rewrite the assert:

static_assert(sizeof(std::declval<Instance*>()->cachedStackLimit()) == sizeof(uint64_t), "");

It works.
Comment 1 Michael Catanzaro 2021-04-20 13:02:43 PDT
Created attachment 426584 [details]
Patch
Comment 2 EWS 2021-04-20 19:38:22 PDT
Committed r276343 (236821@main): <https://commits.webkit.org/236821@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 426584 [details].
Comment 3 Radar WebKit Bug Importer 2021-04-23 01:08:19 PDT
<rdar://problem/77061153>