Title: [276343] trunk/Source/_javascript_Core
- Revision
- 276343
- Author
- [email protected]
- Date
- 2021-04-20 19:38:11 -0700 (Tue, 20 Apr 2021)
Log Message
Static asserts in WasmAirIRGenerator.cpp and WasmB3IRGenerator.cpp trigger -Wnonnull warnings with GCC 11
https://bugs.webkit.org/show_bug.cgi?id=224826
Patch by Michael Catanzaro <[email protected]> on 2021-04-20
Reviewed by Yusuke Suzuki.
Rewrite these static asserts to avoid warnings when built with GCC 11. Credit to Jonathan
Wakely for providing this mind-bending solution.
* wasm/WasmAirIRGenerator.cpp:
(JSC::Wasm::AirIRGenerator::restoreWebAssemblyGlobalState):
(JSC::Wasm::AirIRGenerator::addCurrentMemory):
* wasm/WasmB3IRGenerator.cpp:
(JSC::Wasm::B3IRGenerator::addCurrentMemory):
Modified Paths
Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (276342 => 276343)
--- trunk/Source/_javascript_Core/ChangeLog 2021-04-21 01:42:52 UTC (rev 276342)
+++ trunk/Source/_javascript_Core/ChangeLog 2021-04-21 02:38:11 UTC (rev 276343)
@@ -1,5 +1,21 @@
2021-04-20 Michael Catanzaro <[email protected]>
+ Static asserts in WasmAirIRGenerator.cpp and WasmB3IRGenerator.cpp trigger -Wnonnull warnings with GCC 11
+ https://bugs.webkit.org/show_bug.cgi?id=224826
+
+ Reviewed by Yusuke Suzuki.
+
+ Rewrite these static asserts to avoid warnings when built with GCC 11. Credit to Jonathan
+ Wakely for providing this mind-bending solution.
+
+ * wasm/WasmAirIRGenerator.cpp:
+ (JSC::Wasm::AirIRGenerator::restoreWebAssemblyGlobalState):
+ (JSC::Wasm::AirIRGenerator::addCurrentMemory):
+ * wasm/WasmB3IRGenerator.cpp:
+ (JSC::Wasm::B3IRGenerator::addCurrentMemory):
+
+2021-04-20 Michael Catanzaro <[email protected]>
+
-Warray-bounds warning in AirAllocateRegistersByGraphColoring.cpp with GCC 11
https://bugs.webkit.org/show_bug.cgi?id=224782
Modified: trunk/Source/_javascript_Core/wasm/WasmAirIRGenerator.cpp (276342 => 276343)
--- trunk/Source/_javascript_Core/wasm/WasmAirIRGenerator.cpp 2021-04-21 01:42:52 UTC (rev 276342)
+++ trunk/Source/_javascript_Core/wasm/WasmAirIRGenerator.cpp 2021-04-21 02:38:11 UTC (rev 276343)
@@ -944,7 +944,7 @@
if (restoreCachedStackLimit == RestoreCachedStackLimit::Yes) {
// The Instance caches the stack limit, but also knows where its canonical location is.
- static_assert(sizeof(decltype(static_cast<Instance*>(nullptr)->cachedStackLimit())) == sizeof(uint64_t), "");
+ static_assert(sizeof(std::declval<Instance*>()->cachedStackLimit()) == sizeof(uint64_t), "codegen relies on this size");
RELEASE_ASSERT(Arg::isValidAddrForm(Instance::offsetOfPointerToActualStackLimit(), B3::Width64));
RELEASE_ASSERT(Arg::isValidAddrForm(Instance::offsetOfCachedStackLimit(), B3::Width64));
@@ -1263,7 +1263,7 @@
auto AirIRGenerator::addCurrentMemory(ExpressionType& result) -> PartialResult
{
- static_assert(sizeof(decltype(static_cast<Memory*>(nullptr)->size())) == sizeof(uint64_t), "codegen relies on this size");
+ static_assert(sizeof(std::declval<Memory*>()->size()) == sizeof(uint64_t), "codegen relies on this size");
auto temp1 = g64();
auto temp2 = g64();
Modified: trunk/Source/_javascript_Core/wasm/WasmB3IRGenerator.cpp (276342 => 276343)
--- trunk/Source/_javascript_Core/wasm/WasmB3IRGenerator.cpp 2021-04-21 01:42:52 UTC (rev 276342)
+++ trunk/Source/_javascript_Core/wasm/WasmB3IRGenerator.cpp 2021-04-21 02:38:11 UTC (rev 276343)
@@ -879,7 +879,8 @@
auto B3IRGenerator::addCurrentMemory(ExpressionType& result) -> PartialResult
{
- static_assert(sizeof(decltype(static_cast<Memory*>(nullptr)->size())) == sizeof(uint64_t), "codegen relies on this size");
+ static_assert(sizeof(std::declval<Memory*>()->size()) == sizeof(uint64_t), "codegen relies on this size");
+
Value* memory = m_currentBlock->appendNew<MemoryValue>(m_proc, Load, Int64, origin(), instanceValue(), safeCast<int32_t>(Instance::offsetOfMemory()));
Value* handle = m_currentBlock->appendNew<MemoryValue>(m_proc, Load, Int64, origin(), memory, safeCast<int32_t>(Memory::offsetOfHandle()));
Value* size = m_currentBlock->appendNew<MemoryValue>(m_proc, Load, Int64, origin(), handle, safeCast<int32_t>(MemoryHandle::offsetOfSize()));
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes