Fix missing exception check in ProxyObject::performGetPrototype#117
Fix missing exception check in ProxyObject::performGetPrototype#117robobun wants to merge 1 commit intooven-sh:mainfrom
Conversation
When the Proxy's handler doesn't have a getPrototypeOf trap, we call target->getPrototype(globalObject) directly. This can throw an exception (e.g., stack overflow when the target is also a Proxy with a recursive chain), but the code was using RELEASE_AND_RETURN which releases the throw scope without checking for exceptions first. This fix properly checks for exceptions after the getPrototype call before returning, which satisfies WebKit's exception check validation (enabled via validateExceptionChecks). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
WalkthroughModified ProxyObject::performGetPrototype to adjust exception handling when getPrototypeOfMethod is undefined, replacing RELEASE_AND_RETURN with separate RETURN_IF_EXCEPTION check after obtaining the target prototype. Changes
Pre-merge checks✅ Passed checks (2 passed)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: ASSERTIVE Plan: Pro Disabled knowledge base sources:
📒 Files selected for processing (1)
🧰 Additional context used📓 Path-based instructions (3)**/Source/JavaScriptCore/runtime/**/*.{h,cpp,mm}📄 CodeRabbit inference engine (CLAUDE.md)
Files:
**/Source/JavaScriptCore/**/*.{cpp,mm}📄 CodeRabbit inference engine (CLAUDE.md)
Files:
Source/JavaScriptCore/**/*.{cpp,h}📄 CodeRabbit inference engine (Source/JavaScriptCore/CLAUDE.md)
Files:
🔇 Additional comments (1)
Warning Review ran into problems🔥 ProblemsGit: Failed to clone repository. Please run the Comment |
Summary
When the Proxy's handler doesn't have a
getPrototypeOftrap, we calltarget->getPrototype(globalObject)directly. This can throw an exception (e.g., stack overflow when the target is also a Proxy with a recursive chain), but the code was usingRELEASE_AND_RETURNwhich releases the throw scope without checking for exceptions first.This fix properly checks for exceptions after the
getPrototypecall before returning, which satisfies WebKit's exception check validation (enabled viavalidateExceptionChecks).Changes
Test case
This test in Bun reproduces the issue:
When run with
BUN_JSC_validateExceptionChecks=1, this triggers:🤖 Generated with Claude Code