Skip to content

GET_OP1_OBJ_ZVAL_PTR_DEREF does not actually DEREF #18745

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
TimWolla opened this issue Jun 3, 2025 · 0 comments · May be fixed by #18746
Open

GET_OP1_OBJ_ZVAL_PTR_DEREF does not actually DEREF #18745

TimWolla opened this issue Jun 3, 2025 · 0 comments · May be fixed by #18746

Comments

@TimWolla
Copy link
Member

TimWolla commented Jun 3, 2025

Description

The following code:

ZEND_VM_COLD_CONST_HANDLER(110, ZEND_CLONE, ANY, ANY)
// …
	obj = GET_OP1_OBJ_ZVAL_PTR_DEREF(BP_VAR_R);
	ZEND_ASSERT(!Z_ISREF_P(obj));

Resulted in this output:

php: Zend/zend_vm_execute.h:2812: const zend_op *ZEND_CLONE_SPEC_HANDLER(zend_execute_data *, const zend_op *): Assertion `!(zval_get_type(&(*(obj))) == 10)' failed.

But I expected this output instead:

No assertion failure

Found as part of the clone-with work, while investigating whether or not the current OPcode specialization for ZEND_CLONE is meaningful or not. A specialized handler for CONST likely is not necessary, since object literals are not a thing.

PHP Version

git master

Operating System

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant