diff options
author | Antony Dovgal <tony2001@php.net> | 2006-03-22 22:05:51 +0000 |
---|---|---|
committer | Antony Dovgal <tony2001@php.net> | 2006-03-22 22:05:51 +0000 |
commit | f7ce1d6260b8f6aee72e8f7bca5133ec0ce41a6b (patch) | |
tree | baf3cb2dc48d13b400d7824c2f2c6d2385b68fd5 | |
parent | 32f611097f68425f9ffa94b01ad361cc6e952d42 (diff) | |
download | php-git-f7ce1d6260b8f6aee72e8f7bca5133ec0ce41a6b.tar.gz |
prevent segfault when exception is thrown from Countable::count()
-rw-r--r-- | ext/standard/array.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/ext/standard/array.c b/ext/standard/array.c index 03f6bfaafd..6cc929ba4b 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -312,8 +312,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 |