com php-src: Fixed issues spotted by code review: Zend/zend_c losures.c
| From: | Tjerk Anne Meesters | Date: | Mon, 18 Aug 2014 13:47:57 +0000 |
| Subject: | com php-src: Fixed issues spotted by code review: Zend/zend_c losures.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-81155@lists.php.net to get a copy of this message | ||
Commit: 2f40631716aec538ce9c1c4ae0e71aed396aa2cd
Author: Andrea Faulds <ajf@ajf.me> Mon, 18 Aug 2014 14:47:57 +0100
Parents: 333a465751aad417997a18ee3080c46d97986a91
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=2f40631716aec538ce9c1c4ae0e71aed396aa2cd
Log:
Fixed issues spotted by code review
Changed paths:
M Zend/zend_closures.c
Diff:
diff --git a/Zend/zend_closures.c b/Zend/zend_closures.c
index e76e0d1..b613c69 100644
--- a/Zend/zend_closures.c
+++ b/Zend/zend_closures.c
@@ -92,16 +92,16 @@ ZEND_METHOD(Closure, call) /* {{{ */
if (closure->func.type == ZEND_INTERNAL_FUNCTION) {
/* verify that we aren't binding internal function to a wrong object */
- if((closure->func.common.fn_flags & ZEND_ACC_STATIC) == 0 &&
+ if ((closure->func.common.fn_flags & ZEND_ACC_STATIC) == 0 &&
!instanceof_function(Z_OBJCE_P(newthis), closure->func.common.scope TSRMLS_CC)) {
zend_error(E_WARNING, "Cannot bind function %s::%s to object of class %s",
closure->func.common.scope->name->val, closure->func.common.function_name->val,
Z_OBJCE_P(newthis)->name->val);
RETURN_NULL();
}
}
+ /* This should never happen as this closure must, by definition, be a callable */
if (zend_fcall_info_init(zclosure, 0, &fci, &fci_cache, NULL, NULL TSRMLS_CC) != SUCCESS)
{
- zend_error(E_ERROR, "Closure not callable");
- RETURN_NULL();
+ ZEND_ASSERT(0);
}
fci.retval = &closure_result;