LibJS: Add a sanity check to bytecodes argument_list_evaluation

This commit is contained in:
Hendiadyoin1 2022-10-30 12:32:47 +01:00 committed by Andreas Kling
commit 1e1bf84e6d
Notes: sideshowbarker 2024-07-17 18:46:30 +09:00

View file

@ -569,6 +569,12 @@ static MarkedVector<Value> argument_list_evaluation(Bytecode::Interpreter& inter
MarkedVector<Value> argument_values { vm.heap() };
auto arguments = interpreter.accumulator();
if (!(arguments.is_object() && is<Array>(arguments.as_object()))) {
dbgln("Call arguments are not an array, but: {}", arguments.to_string_without_side_effects());
dbgln("PC: {}[{:4x}]", interpreter.current_block().name(), interpreter.pc());
interpreter.current_executable().dump();
VERIFY_NOT_REACHED();
}
auto& argument_array = arguments.as_array();
auto array_length = argument_array.indexed_properties().array_like_size();