Language: isolate generator try/catch across yield (#22869)#22878
Merged
Conversation
…urn fatals (#22869) Suspended generator try handlers were left in activeTryHandlerFrames and swallowed caller exceptions (silent exit 0). Save/restore try state per generator resume and bubble finally-then-uncaught throws via GeneratorUncaughtThrow. Co-authored-by: Cursor <cursoragent@cursor.com>
This was referenced Jul 24, 2026
PurHur
added a commit
that referenced
this pull request
Jul 24, 2026
Post-#22873 merge #22878 moved live lowering_source_fingerprint to d65fbcf5… while the committed stamp stayed at 0859c4ca…, redding north-star5-verify-fast step 4f-m and user_release_ready. Restamp only; honest verified-fresh remains on #22642/#22717. Co-authored-by: PurHur <PurHur@users.noreply.github.com> Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
activeTryHandlerFrames/tryMergeBlockIdsacross generator suspend/resume so a suspended generatortry/catchcannot absorb caller uncaught exceptions (silent exit 0).try/finallywith no catch, bubble viaGeneratorUncaughtThrowinstead ofraiseUncaughtExceptionwhile still inside advance (keeps foreach caller catch working).Generator::getReturn()after throw→yield-in-catch.Closes #22869
php-src reference
Zend/zend_generators.c—zend_generator_get_return/ throw→catch yield suspensionPHP implementation
lib/VM.php—advanceGeneratorIterationtry-handler isolation;resumeCatchAfterFinallygenerator/fiber bubblelib/VM/GeneratorState.php—suspendedTryHandlerFrames/suspendedTryMergeBlockIdsTest plan
php bin/vm.php test/repro/issue_22869_generator_getreturn_uncaught.php→ fatal + exit 255./script/phpunit.sh --filter GeneratorVMTest→ OK (33)./script/ci-fast.sh(AOT smoke slow under host load; not required for this VM-only path)Verification
Trust probe (this run)
north-star5-fastred on master (gen-0 manifest Self-host M5: bootstrap-inventory argv driver size floor — grow beyond 451KB stub #8713/Gen-1+ #1492: committed gen-0 seed cannot be rebuilt — refresh OOMs at 48 GiB, 44 restamps since the blob last changed (script/bootstrap-refresh-gen0-sidecar.sh) #22642) — unrelated;user_release_ready: noMade with Cursor