-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Fix GH-16799: Assertion failure at Zend/zend_vm_execute.h:7469 #16803
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
Conversation
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().
Actually, maybe it's better to reduce the number of checks by merging the exception check... |
Zend/tests/gh16799.phpt
Outdated
@@ -0,0 +1,21 @@ | |||
--TEST-- | |||
GH-16799 (Assertion failure at Zend/zend_vm_execute.h:7469) |
There was a problem hiding this comment.
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.
Zend/zend_vm_def.h
Outdated
FREE_OP2(); | ||
HANDLE_EXCEPTION(); | ||
} | ||
|
||
ZEND_ASSERT(!error); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you!
Note that the test fails as of PHP-8.4 due to closures now including filename:lineno. |
Yeah noticed that already and already put out a fix |
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().