ladybird/Libraries/LibJS/Bytecode
Andreas Kling be5320b67c LibJS: Evaluate ToNumber for out-of-bounds typed array writes
The interpreter's fast path for PutByValue on a typed array treated an
out-of-bounds index as a silent no-op and returned without touching the
value. That is observably wrong: TypedArraySetElement evaluates
ToNumber(value) before checking the index, so a value with a valueOf
side effect must still have that side effect run even when the store is
ultimately discarded.

Fall back to the slow path on an out-of-bounds or otherwise invalid
index instead of reporting success. The slow path runs the full
TypedArraySetElement algorithm, which performs the coercion and then
discards the write. Direct assignment now matches Reflect.set, which
already went through the slow path.

Fixes the staging/sm typed array out-of-bounds ToNumber test262 case
and adds a test-js regression covering direct assignment, Reflect.set,
and Reflect.defineProperty.
2026-06-17 21:24:33 +02:00
..
AsmInterpreter LibJS: Evaluate ToNumber for out-of-bounds typed array writes 2026-06-17 21:24:33 +02:00
BuiltinAbstractOperationsEnabled.h LibJS: Introduce NativeJavaScriptBackedFunction 2025-11-30 11:54:54 +01:00
Builtins.h LibJS: Remove obsolete bytecode dump formatting helpers 2026-06-15 02:41:57 +02:00
Bytecode.def LibJS: Preserve resolved assignment bindings 2026-05-22 01:56:57 +02:00
ClassBlueprint.h LibJS+LibWeb: Keep cached script source text lazy 2026-05-18 09:18:35 +02:00
Debug.h LibJS: Move bytecode interpreter state to VM 2026-04-13 18:29:43 +02:00
Executable.cpp LibJS: Remove unused C++ local variable wrapper 2026-06-15 02:41:57 +02:00
Executable.h LibJS: Remove unused C++ local variable wrapper 2026-06-15 02:41:57 +02:00
IdentifierTable.cpp LibJS+LibWeb+WebContent: Port JS::PropertyKey to UTF-16 2025-08-05 07:07:15 -04:00
IdentifierTable.h LibJS: Pre-size bytecode materialization tables 2026-05-19 11:32:50 +02:00
Instruction.cpp LibJS: Move bytecode block counting to Rust 2026-06-15 02:41:57 +02:00
Instruction.h LibJS: Remove unused bytecode instruction stream iterator 2026-06-15 02:41:57 +02:00
Interpreter.cpp LibJS: Move bytecode instruction dumping to Rust 2026-06-15 02:41:57 +02:00
Label.h LibJS: Remove obsolete bytecode dump formatting helpers 2026-06-15 02:41:57 +02:00
Operand.h LibJS: Remove obsolete bytecode dump formatting helpers 2026-06-15 02:41:57 +02:00
PropertyAccess.h LibJS: Fix destructured primitive string const loops 2026-05-22 01:56:57 +02:00
PropertyKeyTable.cpp LibJS: Cache fully-formed PropertyKeys in Executable 2025-12-11 14:34:45 -06:00
PropertyKeyTable.h LibJS: Pre-size bytecode materialization tables 2026-05-19 11:32:50 +02:00
PropertyNameIterator.cpp LibJS: Account runtime storage as external memory 2026-05-07 10:03:09 +02:00
PropertyNameIterator.h LibJS: Account runtime storage as external memory 2026-05-07 10:03:09 +02:00
PutKind.h LibJS: Consolidate Put bytecode instructions and reduce code bloat 2026-03-04 18:53:12 +01:00
RegexTable.cpp LibRegex: Add ECMAScriptRegex and migrate callers 2026-03-27 17:32:19 +01:00
RegexTable.h LibJS: Account executable storage as external memory 2026-05-07 10:03:09 +02:00
Register.h LibJS: Remove obsolete bytecode dump formatting helpers 2026-06-15 02:41:57 +02:00
StringTable.cpp LibJS+LibWeb: Port interned bytecode strings to UTF-16 2025-08-14 10:27:08 +02:00
StringTable.h LibJS: Pre-size bytecode materialization tables 2026-05-19 11:32:50 +02:00
Validator.cpp LibJS: Infer computed property function names 2026-05-22 01:56:57 +02:00
Validator.h LibJS: Store bytecode cache indexes instead of pointers 2026-05-18 20:35:14 +02:00