Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: ea5b70ec2dabd4648328bb05ea51aa0c4d43596e
https://github.com/WebKit/WebKit/commit/ea5b70ec2dabd4648328bb05ea51aa0c4d43596e
Author: Brady Eidson <[email protected]>
Date: 2025-11-13 (Thu, 13 Nov 2025)
Changed paths:
M Source/WebKit/Shared/JavaScriptEvaluationResult.cpp
M Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebViewEvaluateJavaScript.mm
Log Message:
-----------
Teach JSExtractor to avoid stack overflow when serializing particularly deep
objects
rdar://164138230
Reviewed by Geoffrey Garen.
By being recursive when serializing JavaScript objects for IPC, we became
limited by
stack depth.
We'll switch JSExtractor to be iterative in rdar://164658717, but for now let's
avoid
crashing the WebContent process by detecting whether or not it is safe to keep
recursing.
Test: Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebViewEvaluateJavaScript.mm
* Source/WebKit/Shared/JavaScriptEvaluationResult.cpp:
(WebKit::JavaScriptEvaluationResult::JSExtractor::isSafeToRecurse):
(WebKit::JavaScriptEvaluationResult::JSExtractor::addObjectToMap):
(WebKit::JavaScriptEvaluationResult::JSExtractor::toValue):
* Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebViewEvaluateJavaScript.mm:
((EvaluateJavaScript, Serialization)):
Canonical link: https://commits.webkit.org/303006@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications