Procházet zdrojové kódy

LibWeb: Don't store reference to temporary in resolve_module_specifier

An environment settings object will return a copy to the URL. From a
quick glance, we could probably make an environment settings object
return a reference to one, but let's just change this code to make
a copy since its not safe to rely on that.
Shannon Booth před 8 měsíci
rodič
revize
43f75dcba0
1 změnil soubory, kde provedl 2 přidání a 2 odebrání
  1. 2 2
      Libraries/LibWeb/HTML/Scripting/Fetching.cpp

+ 2 - 2
Libraries/LibWeb/HTML/Scripting/Fetching.cpp

@@ -85,8 +85,8 @@ ByteString module_type_from_module_request(JS::ModuleRequest const& module_reque
 WebIDL::ExceptionOr<URL::URL> resolve_module_specifier(Optional<Script&> referring_script, ByteString const& specifier)
 {
     // 1. Let settingsObject and baseURL be null.
-    Optional<EnvironmentSettingsObject&> settings_object;
-    Optional<URL::URL const&> base_url;
+    GC::Ptr<EnvironmentSettingsObject> settings_object;
+    Optional<URL::URL> base_url;
 
     // 2. If referringScript is not null, then:
     if (referring_script.has_value()) {