helly Tue Mar 16 05:14:59 2004 EDT Modified files: /ZendEngine2 zend_execute.c zend_execute.h zend_execute_API.c /php-src/main main.c Log: Improve error message http://cvs.php.net/diff.php/ZendEngine2/zend_execute.c?r1=1.622&r2=1.623&ty=u Index: ZendEngine2/zend_execute.c diff -u ZendEngine2/zend_execute.c:1.622 ZendEngine2/zend_execute.c:1.623 --- ZendEngine2/zend_execute.c:1.622 Tue Mar 9 11:38:33 2004 +++ ZendEngine2/zend_execute.c Tue Mar 16 05:14:49 2004 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_execute.c,v 1.622 2004/03/09 16:38:33 helly Exp $ */ +/* $Id: zend_execute.c,v 1.623 2004/03/16 10:14:49 helly Exp $ */ #define ZEND_INTENSIVE_DEBUGGING 0 @@ -3001,8 +3001,10 @@ zend_uint arg_num = opline->op1.u.constant.value.lval; if (zend_ptr_stack_get_arg(arg_num, (void **) ¶m TSRMLS_CC)==FAILURE) { + char *space; + char *class_name = get_active_class_name(&space TSRMLS_CC); zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, NULL TSRMLS_CC); - zend_error(E_WARNING, "Missing argument %ld for %s()", opline->op1.u.constant.value.lval, get_active_function_name(TSRMLS_C)); + zend_error(E_WARNING, "Missing argument %ld for %s%s%s()", opline->op1.u.constant.value.lval, class_name, space, get_active_function_name(TSRMLS_C)); if (opline->result.op_type == IS_VAR) { PZVAL_UNLOCK(*EX_T(opline->result.u.var).var.ptr_ptr); } http://cvs.php.net/diff.php/ZendEngine2/zend_execute.h?r1=1.71&r2=1.72&ty=u Index: ZendEngine2/zend_execute.h diff -u ZendEngine2/zend_execute.h:1.71 ZendEngine2/zend_execute.h:1.72 --- ZendEngine2/zend_execute.h:1.71 Thu Mar 4 08:11:03 2004 +++ ZendEngine2/zend_execute.h Tue Mar 16 05:14:52 2004 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_execute.h,v 1.71 2004/03/04 13:11:03 stas Exp $ */ +/* $Id: zend_execute.h,v 1.72 2004/03/16 10:14:52 helly Exp $ */ #ifndef ZEND_EXECUTE_H #define ZEND_EXECUTE_H @@ -142,6 +142,7 @@ /* services */ +ZEND_API char *get_active_class_name(char **space TSRMLS_DC); ZEND_API char *get_active_function_name(TSRMLS_D); ZEND_API char *zend_get_executed_filename(TSRMLS_D); ZEND_API uint zend_get_executed_lineno(TSRMLS_D); http://cvs.php.net/diff.php/ZendEngine2/zend_execute_API.c?r1=1.276&r2=1.277&ty=u Index: ZendEngine2/zend_execute_API.c diff -u ZendEngine2/zend_execute_API.c:1.276 ZendEngine2/zend_execute_API.c:1.277 --- ZendEngine2/zend_execute_API.c:1.276 Sun Mar 14 13:00:40 2004 +++ ZendEngine2/zend_execute_API.c Tue Mar 16 05:14:52 2004 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_execute_API.c,v 1.276 2004/03/14 18:00:40 andi Exp $ */ +/* $Id: zend_execute_API.c,v 1.277 2004/03/16 10:14:52 helly Exp $ */ #include <stdio.h> #include <signal.h> @@ -297,6 +297,35 @@ } +/* return class name and "::" or "". */ +ZEND_API char *get_active_class_name(char **space TSRMLS_DC) +{ + if (!zend_is_executing(TSRMLS_C)) { + if (space) { + *space = ""; + } + return ""; + } + switch (EG(function_state_ptr)->function->type) { + case ZEND_USER_FUNCTION: + case ZEND_INTERNAL_FUNCTION: + { + zend_class_entry *ce = EG(function_state_ptr)->function->common.scope; + + if (space) { + *space = ce ? "::" : ""; + } + return ce ? ce->name : ""; + } + default: + if (space) { + *space = ""; + } + return ""; + } +} + + ZEND_API char *get_active_function_name(TSRMLS_D) { if (!zend_is_executing(TSRMLS_C)) { http://cvs.php.net/diff.php/php-src/main/main.c?r1=1.596&r2=1.597&ty=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.596 php-src/main/main.c:1.597 --- php-src/main/main.c:1.596 Sun Mar 14 18:56:07 2004 +++ php-src/main/main.c Tue Mar 16 05:14:57 2004 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: main.c,v 1.596 2004/03/14 23:56:07 helly Exp $ */ +/* $Id: main.c,v 1.597 2004/03/16 10:14:57 helly Exp $ */ /* {{{ includes */ @@ -424,34 +424,6 @@ } /* }}} */ -/* {{{ get_active_class_name */ -static char *get_active_class_name(char **space TSRMLS_DC) -{ - if (!zend_is_executing(TSRMLS_C)) { - if (space) { - *space = ""; - } - return ""; - } - switch (EG(function_state_ptr)->function->type) { - case ZEND_USER_FUNCTION: - case ZEND_INTERNAL_FUNCTION: - { - zend_class_entry *ce = EG(function_state_ptr)->function->common.scope; - - if (space) { - *space = ce ? "::" : ""; - } - return ce ? ce->name : ""; - } - default: - if (space) { - *space = ""; - } - return ""; - } -} -/* }}} */ /* }}} */ /* {{{ php_verror */
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php