Skip to content

Truly independent web browser

LibWeb: Hold the values of a resolved overload in a ConservativeVector

Shannon Booth3a47b9a9e701
diff --git a/Libraries/LibWeb/WebIDL/OverloadResolution.cpp b/Libraries/LibWeb/WebIDL/OverloadResolution.cpp
index 8d9f1eec153..11f79b19b87 100644
--- a/Libraries/LibWeb/WebIDL/OverloadResolution.cpp
+++ b/Libraries/LibWeb/WebIDL/OverloadResolution.cpp
@@ -104,7 +104,7 @@ JS::ThrowCompletionOr<ResolvedOverload> resolve_overload(JS::VM& vm, EffectiveOv
distinguishing_argument_index = overloads.distinguishing_argument_index();
// 9. Initialize values to be an empty list, where each entry will be either an IDL value or the special value “missing”.
- Vector<ResolvedOverload::Argument> values;
+ GC::ConservativeVector<ResolvedOverload::Argument> values;
// 10. Initialize i to 0.
auto i = 0;
diff --git a/Libraries/LibWeb/WebIDL/OverloadResolution.h b/Libraries/LibWeb/WebIDL/OverloadResolution.h
index c9d097cf7ee..9db8f9d3af7 100644
--- a/Libraries/LibWeb/WebIDL/OverloadResolution.h
+++ b/Libraries/LibWeb/WebIDL/OverloadResolution.h
@@ -9,6 +9,7 @@
#include <AK/Optional.h>
#include <AK/Span.h>
#include <AK/Vector.h>
+#include <LibGC/ConservativeVector.h>
#include <LibJS/Runtime/VM.h>
#include <LibWeb/Export.h>
#include <LibWeb/WebIDL/OverloadTypes.h>
@@ -21,7 +22,7 @@ struct ResolvedOverload {
using Argument = Variant<JS::Value, Missing>;
int callable_id;
- Vector<Argument> arguments;
+ GC::ConservativeVector<Argument> arguments;
};
// https://webidl.spec.whatwg.org/#es-overloads