-
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
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--TEST-- | ||
GH-16799 (Assertion failure at Zend/zend_vm_execute.h:7469) | ||
--FILE-- | ||
<?php | ||
set_error_handler(function($_, $m) { throw new Exception($m); }); | ||
class Test { | ||
static function test() { | ||
call_user_func("static::ok"); | ||
} | ||
static function ok() { | ||
} | ||
} | ||
Test::test(); | ||
?> | ||
--EXPECTF-- | ||
Fatal error: Uncaught Exception: Use of "static" in callables is deprecated in %s:%d | ||
Stack trace: | ||
#0 %s(%d): {closure}(%d, 'Use of "static"...', %s, %d) | ||
#1 %s(%d): Test::test() | ||
#2 {main} | ||
thrown in %s on line %d |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3806,6 +3806,15 @@ ZEND_VM_HANDLER(118, ZEND_INIT_USER_CALL, CONST, CONST|TMPVAR|CV, NUM) | |
SAVE_OPLINE(); | ||
function_name = GET_OP2_ZVAL_PTR(BP_VAR_R); | ||
if (zend_is_callable_ex(function_name, NULL, 0, NULL, &fcc, &error)) { | ||
/* Deprecation can be emitted from zend_is_callable_ex(), which can | ||
* invoke a user error handler and throw an exception. | ||
* For the CONST and CV case we reuse the same exception block below | ||
* to make sure we don't increase VM size too much. */ | ||
if (!(OP2_TYPE & (IS_TMP_VAR|IS_VAR)) && UNEXPECTED(EG(exception))) { | ||
FREE_OP2(); | ||
HANDLE_EXCEPTION(); | ||
} | ||
|
||
ZEND_ASSERT(!error); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
func = fcc.function_handler; | ||
object_or_called_scope = fcc.called_scope; | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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.