Files
ladybird/Libraries/LibJS/Bytecode
Andreas Kling 47c82b38d0 LibJS: Range-check enum-typed bytecode fields in the validator
The validator now bounds-checks the five enum-shaped field types
that appear in Bytecode.def: Completion::Type, IteratorHint,
EnvironmentMode, PutKind, and ArgumentsKind. The codegen
recognizes each by its .def type name and emits a u32 read plus a
range check against the corresponding variant count.

The variant counts ride across the FFI as new fields on
FFIValidatorBounds rather than being hardcoded on the Rust side,
so the Rust validator never has to know which variants the C++
enum currently defines. The C++ side computes each count as
`to_underlying(LastVariant) + 1` with a static_assert pinning the
expected value, so adding or removing a variant in any of these
enums fails the build until the validator is updated.
2026-05-03 08:43:19 +02:00
..
2026-03-20 12:03:36 +01:00
2026-03-20 12:03:36 +01:00
2026-03-20 12:03:36 +01:00