mirror of
https://github.com/php/php-src.git
synced 2025-01-11 05:24:49 +08:00
MF51: prevent segfault when exception is thrown from Countable::count()
This commit is contained in:
parent
e0cd1b87a8
commit
932c5d9e0e
@ -318,8 +318,10 @@ PHP_FUNCTION(count)
|
||||
|
||||
if (Z_OBJ_HT_P(array)->get_class_entry && instanceof_function(Z_OBJCE_P(array), spl_ce_Countable TSRMLS_CC)) {
|
||||
zend_call_method_with_0_params(&array, NULL, NULL, "count", &retval);
|
||||
RETVAL_LONG(Z_LVAL_P(retval));
|
||||
zval_ptr_dtor(&retval);
|
||||
if (retval) {
|
||||
RETVAL_LONG(Z_LVAL_P(retval));
|
||||
zval_ptr_dtor(&retval);
|
||||
}
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user