Language: default engine-thrown Throwable getCode() to 0 (#22945)#22951
Merged
Conversation
PurHur
force-pushed
the
agent/issue-22945-engine-getcode-default
branch
from
July 25, 2026 10:37
1ee801e to
f01cfe6
Compare
materializeThrowable left PROP_CODE unset, so getCode() fatals on engine-bridged Error/TypeError/DivisionByZeroError. Match zend_exceptions default code=0; fold DivisionByZero materialize onto the shared path. Co-authored-by: Cursor <cursoragent@cursor.com>
PurHur
force-pushed
the
agent/issue-22945-engine-getcode-default
branch
from
July 25, 2026 10:37
f01cfe6 to
92b2b44
Compare
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
Error/TypeError/DivisionByZeroErrorleftExceptionSupport::PROP_CODEunset inBuiltinExceptionSupport::materializeThrowable(), soThrowable::getCode()fatals on uninitializedVariable::$integer.code = 0to match php-srczend_throw_exception/zend_exception_get_props; foldmaterializeDivisionByZeroError()onto the shared path (net shrink of duplicated ObjectEntry setup).test/compliance/cases/language/engine_throwable_getcode_default.phpt.docs/bootstrap-inventory.md(OK 6517/6517).Closes #22945
php-src reference
Zend/zend_exceptions.c— default throwable code is 0lib/VM/BuiltinExceptionSupport.php); no C runtime changesTest plan
php bin/vm.php /tmp/engine_getcode.php→ all codes matchvendor/bin/phpunit --filter engine_throwable_getcode_default test/compliance/VMTest.php→ OKexception_throw_code|exception_throw_caught|error_exception→ OKphp script/bootstrap-inventory.php --check→OK 6517/6517./script/ci-fast.sh(in flight in Docker)Verification transcript
C runtime: 0 lines added; PHP path only (duplicated DivisionByZero materializer removed).
Made with Cursor