Fix var_dump(property_exists(), isset()) mixed sibling arg wiring (#15646) - #35671
Merged
Merged
Conversation
…ducers (#15646) When hoisted call-arg producers align 1:1 with call args but arg #0 is a FuncCall and arg #1 is Isset_, findHoistedIssetOrEmptyProducerForCallArg must not fall back to hoisted[0] (the Isset_) for earlier args — that stole isset's slot for property_exists and broke var_dump on uninitialized typed properties. Also assert PropertyExistsJitHelper::existsArgv returns int 0/1, not strict false. Verified: - ./script/aot-smoke.sh → 8 passed, 0 failed - ./script/phpunit.sh --filter 'InlineCallArgProducerSlotTest::testVarDumpPropertyExistsIssetUninitTypedProperty|PropertyExistsIncompleteClassTest' → OK - php bin/vm.php: var_dump(property_exists($o,'x'), isset($o->x)) → bool(true)\nbool(false) Closes #15646 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
findHoistedIssetOrEmptyProducerForCallArg()fell through tohoisted[$argIndex]when producers already aligned 1:1 with call args but arg #0 was a hoistedFuncCall(e.g.property_exists) and arg Php stdlib specs implementation #1 wasisset(). That mapped arg #0 to the Isset_ slot, sovar_dump(property_exists($o,'x'), isset($o->x))printedbool(false)\nbool(false)instead of Zend'sbool(true)\nbool(false).PropertyExistsJitHelper::existsArgv()returnsint0/1 for JIT ABI (AOT: invalid IR — module verification fails for pow, base_convert, property_exists, function-static string write #31966); unit test now usesassertSame(0, …)instead of strictassertFalse.php-src
Zend/zend_compile.c— sibling call-arg temps; observable behavior matchesproperty_exists()+isset()on uninitialized typed properties (Zend/zend_builtin_functions.c,zend_object_handlers.c).Verification
Closes #15646
Made with Cursor