Skip to content

Conversation

nielsdos
Copy link
Member

zend_is_callable_ex() can unfortunately emit a deprecation, and then a user error handler can throw an exception. This causes an assert failure at ZEND_VM_NEXT_OPCODE(). We fix this by checking if there's an exception after zend_is_callable_ex().

zend_is_callable_ex() can unfortunately emit a deprecation, and then
a user error handler can throw an exception. This causes an assert
failure at ZEND_VM_NEXT_OPCODE(). We fix this by checking if there's an
exception after zend_is_callable_ex().
@nielsdos
Copy link
Member Author

nielsdos commented Nov 14, 2024

Actually, maybe it's better to reduce the number of checks by merging the exception check...
EDIT: merged the checks
EDIT: changed it again so that we don't increase VM size too much by reusing the exception block if possible, and if not adding a new one

@@ -0,0 +1,21 @@
--TEST--
GH-16799 (Assertion failure at Zend/zend_vm_execute.h:7469)
Copy link
Member

Choose a reason for hiding this comment

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

Nit: The lineno is pretty useless.

HANDLE_EXCEPTION();
}

ZEND_ASSERT(!error);
Copy link
Member

Choose a reason for hiding this comment

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

This assert still applies? Can we move it up?

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

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.

LGTM, thank you!

@nielsdos nielsdos closed this in 553d79c Nov 15, 2024
@cmb69
Copy link
Member

cmb69 commented Nov 15, 2024

Note that the test fails as of PHP-8.4 due to closures now including filename:lineno.

@nielsdos
Copy link
Member Author

Yeah noticed that already and already put out a fix

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.

Assertion failure at Zend/zend_vm_execute.h:7469

3 participants