From 9949173fce33b813bc4b1f207bb8a3599016bd09 Mon Sep 17 00:00:00 2001 From: Timothy Flynn Date: Thu, 31 Oct 2024 12:21:37 -0400 Subject: [PATCH] LibJS: Do not store console table columns and rows in a plain vector These values may contain Object types. --- Userland/Libraries/LibJS/Console.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Userland/Libraries/LibJS/Console.cpp b/Userland/Libraries/LibJS/Console.cpp index 7472c52f04a..80fdef30c03 100644 --- a/Userland/Libraries/LibJS/Console.cpp +++ b/Userland/Libraries/LibJS/Console.cpp @@ -143,7 +143,7 @@ ThrowCompletionOr Console::log() } // To [create table row] given tabularDataItem, rowIndex, list finalColumns, and optional list properties, perform the following steps: -static ThrowCompletionOr> create_table_row(Realm& realm, Value row_index, Value tabular_data_item, Vector& final_columns, HashMap& visited_columns, HashMap& properties) +static ThrowCompletionOr> create_table_row(Realm& realm, Value row_index, Value tabular_data_item, MarkedVector& final_columns, HashMap& visited_columns, HashMap& properties) { auto& vm = realm.vm(); @@ -265,10 +265,10 @@ ThrowCompletionOr Console::table() } // 1. Let `finalRows` be the new list, initially empty - Vector final_rows; + MarkedVector final_rows(vm.heap()); // 2. Let `finalColumns` be the new list, initially empty - Vector final_columns; + MarkedVector final_columns(vm.heap()); HashMap visited_columns;