[WASM] Fix warning: cast from ‘char*’ to ‘JSC::Wasm::Type*’ increases required alignment of target type [-Wcast-align]
Created attachment 458227 [details] Patch
Comment on attachment 458227 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=458227&action=review Commented. > Source/JavaScriptCore/wasm/WasmTypeDefinition.h:83 > + void* const m_payload; I wonder if we should just change it to `Type*`. > Source/JavaScriptCore/wasm/WasmTypeDefinition.h:121 > + void* const m_payload; How about changing it to `StructField*`?
Created attachment 458266 [details] Patch
Comment on attachment 458266 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=458266&action=review > Source/JavaScriptCore/wasm/WasmTypeDefinition.h:132 > + : m_typeHeader { FunctionSignature { reinterpret_cast<Type*>(payload()), argCount, retCount } } Casting from void* can and should be done with static_cast instead of reinterpret_cast. > Source/JavaScriptCore/wasm/WasmTypeDefinition.h:137 > + : m_typeHeader { StructType { reinterpret_cast<StructField*>(payload()), fieldCount } } Ditto. > Source/JavaScriptCore/wasm/WasmTypeDefinition.h:142 > + void* payload() { return reinterpret_cast<void*>(this + 1); } This should not need a type cast. TypeDefinition* can be converted to void* without one
Created attachment 458328 [details] Patch
Committed r293492 (250025@main): <https://commits.webkit.org/250025@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 458328 [details].
<rdar://problem/92372097>