From 1c826480192648ccf0253405c7fac74506bb01f3 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Sat, 10 Oct 2026 14:24:28 +0000 Subject: [PATCH] Fix FilterEffect size assertion on 32-bit x86 On i686, 64-bit fields only have 4-byte alignment, so FilterEffect is 84 bytes rather than the 88 bytes seen on other 32-bit targets such as armv7 and wasm32. Assert the size per architecture. --- crates/anyrender/src/filters.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/anyrender/src/filters.rs b/crates/anyrender/src/filters.rs index b8eed24..2b7d7de 100644 --- a/crates/anyrender/src/filters.rs +++ b/crates/anyrender/src/filters.rs @@ -430,7 +430,10 @@ pub enum FilterEffect { // This is just for documentation purposes. Feel free to update the value as necessary #[cfg(target_pointer_width = "64")] const _: [u8; 128] = [0; std::mem::size_of::()]; -#[cfg(target_pointer_width = "32")] +// On 32-bit x86, 64-bit fields only have 4-byte alignment. +#[cfg(all(target_pointer_width = "32", target_arch = "x86"))] +const _: [u8; 84] = [0; std::mem::size_of::()]; +#[cfg(all(target_pointer_width = "32", not(target_arch = "x86")))] const _: [u8; 88] = [0; std::mem::size_of::()]; impl FilterEffect {