Skip to content

Conversation

@ndossche
Copy link
Member

@ndossche ndossche commented Oct 22, 2025

Note that ZEND_COPY_TMP isn't even valid for CONSTs, and we would need to add a ref even if it were, so just add special handling instead to simplify it.

Regressed in #19658

Issue: https://issues.oss-fuzz.com/issues/454273637

Note that ZEND_COPY_TMP isn't even valid for CONSTs, and we would need
to add a ref even if it were, so just add special handling instead to
simplify it.
Copy link
Member

@iluuu1994 iluuu1994 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks correct to me 👍

zend_emit_op(NULL, ZEND_ECHO, &rope_result, NULL);
zend_emit_op_tmp(result, ZEND_STRLEN, &copy, NULL);
if (rope_result.op_type != IS_CONST) {
/* Note: ZEND_COPY_TMP is only valid for TMPVAR. */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe ZEND_ASSERT(rope_result.op_type == IS_TMP_VAR);?

@ndossche ndossche merged commit 09c39a8 into php:master Oct 23, 2025
10 checks passed
{
/* Special case: printf with a single constant string argument and no format specifiers.
* In this case, just emit ECHO and return the string length if needed. */
if (args->children == 1) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this entire branch obsolete now?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't check but I guess so, although this still skips some work.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants