summaryrefslogtreecommitdiff
path: root/Userland/Libraries
diff options
context:
space:
mode:
authorHendiadyoin1 <leon.a@serenityos.org>2022-10-30 12:32:47 +0100
committerAndreas Kling <kling@serenityos.org>2022-11-01 11:21:18 +0100
commit1e1bf84e6d73defe618ff5d96654022c740ee7f5 (patch)
tree62e82f22e0a7003c951e4927cb3b1665c5630aa8 /Userland/Libraries
parentc9e7d452c5e152dbc30f65a7095aaf21511a6c71 (diff)
downloadserenity-1e1bf84e6d73defe618ff5d96654022c740ee7f5.zip
LibJS: Add a sanity check to bytecodes argument_list_evaluation
Diffstat (limited to 'Userland/Libraries')
-rw-r--r--Userland/Libraries/LibJS/Bytecode/Op.cpp6
1 files changed, 6 insertions, 0 deletions
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<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();