Files
ladybird/AK
kalenikaliaksandr 70a1a9e82f AK: Apply empty base optimization to Variant on Windows
On the MSVC ABI (used by clang-cl), each empty base class is given a
unique address with 1 byte of padding by default. Variant inherits from
a deep chain of empty base classes (InheritFromPacks ->
InheritFromUniqueEntries -> VariantConstructors) for its inherited
constructor mechanism. Without __declspec(empty_bases), the pointer
adjustment in VariantConstructors::internal_cast() from the
VariantConstructors subobject back to the Variant base was computed
incorrectly due to accumulated padding, causing the constructor to write
m_data and m_index at wrong offsets and corrupting the stored object.

This manifested as heap corruption (STATUS_HEAP_CORRUPTION 0xc0000374)
whenever a Variant containing a large type (e.g. ByteCode at 240 bytes)
was destroyed after being constructed through the inherited constructor
path. In practice this crashed `new RegExp('a')` in LibJS on Windows,
preventing ~880 of ~1058 LibJS runtime tests from running.
2026-03-25 00:57:49 +01:00
..
2025-11-20 15:44:25 +01:00
2024-12-04 16:45:58 +00:00
2024-11-20 21:13:23 +01:00
2026-03-20 12:03:36 +01:00
2026-02-17 12:38:51 +00:00
2026-01-29 10:10:12 +01:00
2026-02-17 12:38:51 +00:00
2024-11-19 22:07:01 -07:00
2024-11-10 14:48:20 -07:00
2026-03-20 12:03:36 +01:00
2024-12-28 05:39:32 -08:00
2025-08-23 16:04:36 -06:00
2022-12-03 23:52:23 +00:00
2026-03-20 12:03:36 +01:00
2026-02-18 08:02:45 -05:00
2024-02-11 18:53:00 +01:00
2026-03-20 12:03:36 +01:00
2026-02-17 10:48:09 -05:00