From 1e1bf84e6d73defe618ff5d96654022c740ee7f5 Mon Sep 17 00:00:00 2001 From: Hendiadyoin1 Date: Sun, 30 Oct 2022 12:32:47 +0100 Subject: [PATCH] LibJS: Add a sanity check to bytecodes argument_list_evaluation --- Userland/Libraries/LibJS/Bytecode/Op.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Userland/Libraries/LibJS/Bytecode/Op.cpp b/Userland/Libraries/LibJS/Bytecode/Op.cpp index 7efde7e84c..6d8c00a930 100644 --- a/Userland/Libraries/LibJS/Bytecode/Op.cpp +++ b/Userland/Libraries/LibJS/Bytecode/Op.cpp @@ -569,6 +569,12 @@ static MarkedVector argument_list_evaluation(Bytecode::Interpreter& inter MarkedVector argument_values { vm.heap() }; auto arguments = interpreter.accumulator(); + if (!(arguments.is_object() && is(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();