[webkit-changes] [WebKit/WebKit] 20cd6e: JSExecState::loadModule can dereference null result

David Degazio noreply at github.com
Fri Mar 15 12:32:57 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 20cd6e8fdcc8f08de41531fbcdded308bfd03426
      https://github.com/WebKit/WebKit/commit/20cd6e8fdcc8f08de41531fbcdded308bfd03426
  Author: David Degazio <d_degazio at apple.com>
  Date:   2024-03-15 (Fri, 15 Mar 2024)

  Changed paths:
    M Source/WebCore/bindings/js/JSExecState.h
    M Source/WebCore/bindings/js/ScriptController.cpp
    M Source/WebCore/workers/WorkerOrWorkletScriptController.cpp

  Log Message:
  -----------
  JSExecState::loadModule can dereference null result
https://bugs.webkit.org/show_bug.cgi?id=270934
rdar://121268593

Reviewed by Yusuke Suzuki.

Fixes a bug where JSExecState::loadModule always dereferenced the
result of JSC::loadModule, even though JSC::loadModule will return
null if there is an exception. This patch changes the return type
of JSExecState::loadModule to a raw pointer, so callers of it can
detect and handle null results returned from deeper calls.

* Source/WebCore/bindings/js/JSExecState.h:
(WebCore::JSExecState::loadModule):
* Source/WebCore/bindings/js/ScriptController.cpp:
(WebCore::ScriptController::loadModuleScriptInWorld):
* Source/WebCore/workers/WorkerOrWorkletScriptController.cpp:
(WebCore::WorkerOrWorkletScriptController::loadModuleSynchronously):
(WebCore::WorkerOrWorkletScriptController::loadAndEvaluateModule):

Canonical link: https://commits.webkit.org/276190@main



To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications


More information about the webkit-changes mailing list