mirror of
https://github.com/php/php-src.git
synced 2024-12-01 22:03:36 +08:00
- Fix build, thanks Christian Rodriguez for noticing
# I wonder why the other machine didn't catch this
This commit is contained in:
parent
b4b0816578
commit
7cced8f520
@ -395,7 +395,7 @@ PHP_FUNCTION(spl_autoload_call)
|
||||
Register given function as __autoload() implementation */
|
||||
PHP_FUNCTION(spl_autoload_register)
|
||||
{
|
||||
char *func_name;
|
||||
char *func_name, *error = NULL;
|
||||
int func_name_len;
|
||||
char *lc_name = NULL;
|
||||
zval *zcallable = NULL;
|
||||
@ -420,34 +420,49 @@ PHP_FUNCTION(spl_autoload_register)
|
||||
}
|
||||
}
|
||||
|
||||
if (!zend_is_callable_ex(zcallable, IS_CALLABLE_STRICT, &func_name, &func_name_len, &alfi.ce, &alfi.func_ptr, &obj_ptr TSRMLS_CC)) {
|
||||
if (!zend_is_callable_ex(zcallable, IS_CALLABLE_STRICT, &func_name, &func_name_len, &alfi.ce, &alfi.func_ptr, &obj_ptr, &error TSRMLS_CC)) {
|
||||
if (Z_TYPE_P(zcallable) == IS_ARRAY) {
|
||||
if (!obj_ptr && alfi.func_ptr && !(alfi.func_ptr->common.fn_flags & ZEND_ACC_STATIC)) {
|
||||
if (do_throw) {
|
||||
zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC, "Passed array specifies a non static method but no object");
|
||||
zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC, "Passed array specifies a non static method but no object (%s)", error);
|
||||
}
|
||||
if (error) {
|
||||
efree(error);
|
||||
}
|
||||
efree(func_name);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
else if (do_throw) {
|
||||
zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC, "Passed array does not specify %s %smethod", alfi.func_ptr ? "a callable" : "an existing", !obj_ptr ? "static " : "");
|
||||
zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC, "Passed array does not specify %s %smethod, (%s)", alfi.func_ptr ? "a callable" : "an existing", !obj_ptr ? "static " : "", error);
|
||||
}
|
||||
if (error) {
|
||||
efree(error);
|
||||
}
|
||||
efree(func_name);
|
||||
RETURN_FALSE;
|
||||
} else if (Z_TYPE_P(zcallable) == IS_STRING) {
|
||||
if (do_throw) {
|
||||
zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC, "Function '%s' not %s", func_name, alfi.func_ptr ? "callable" : "found");
|
||||
zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC, "Function '%s' not %s (%s)", func_name, alfi.func_ptr ? "callable" : "found", error);
|
||||
}
|
||||
if (error) {
|
||||
efree(error);
|
||||
}
|
||||
efree(func_name);
|
||||
RETURN_FALSE;
|
||||
} else {
|
||||
if (do_throw) {
|
||||
zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC, "Illegal value passed");
|
||||
zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC, "Illegal value passed (%s)", error);
|
||||
}
|
||||
if (error) {
|
||||
efree(error);
|
||||
}
|
||||
efree(func_name);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
}
|
||||
if (error) {
|
||||
efree(error);
|
||||
}
|
||||
|
||||
lc_name = safe_emalloc(func_name_len, 1, sizeof(long) + 1);
|
||||
zend_str_tolower_copy(lc_name, func_name, func_name_len);
|
||||
@ -501,7 +516,7 @@ skip:
|
||||
Unregister given function as __autoload() implementation */
|
||||
PHP_FUNCTION(spl_autoload_unregister)
|
||||
{
|
||||
char *func_name;
|
||||
char *func_name, *error = NULL;
|
||||
int func_name_len;
|
||||
zval *zcallable;
|
||||
int success = FAILURE;
|
||||
@ -512,7 +527,11 @@ PHP_FUNCTION(spl_autoload_unregister)
|
||||
return;
|
||||
}
|
||||
|
||||
if (!zend_is_callable_ex(zcallable, IS_CALLABLE_CHECK_SYNTAX_ONLY, &func_name, &func_name_len, NULL, NULL, &obj_ptr TSRMLS_CC)) {
|
||||
if (!zend_is_callable_ex(zcallable, IS_CALLABLE_CHECK_SYNTAX_ONLY, &func_name, &func_name_len, NULL, NULL, &obj_ptr, &error TSRMLS_CC)) {
|
||||
zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC, "Unable to unregister invalid function (%s)", error);
|
||||
if (error) {
|
||||
efree(error);
|
||||
}
|
||||
if (func_name) {
|
||||
efree(func_name);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user