Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:12695 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 74916 invoked by uid 1010); 10 Sep 2004 05:57:39 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 74891 invoked from network); 10 Sep 2004 05:57:39 -0000 Received: from unknown (HELO smtp.unet.ru) (213.219.244.56) by pb1.pair.com with SMTP; 10 Sep 2004 05:57:39 -0000 Received: from host.phpclub.net by smtp.unet.ru (8.12.9/Unet) with ESMTP id i8A5vbln097947 for ; Fri, 10 Sep 2004 09:57:38 +0400 (MSD) Received: from s17.hibet.ru by host.phpclub.net (8.12.6/Unet) with ESMTP id i8A5vbCg027128 for ; Fri, 10 Sep 2004 09:57:37 +0400 (MSD) Date: Fri, 10 Sep 2004 09:56:57 +0400 To: php-dev Message-ID: <20040910095657.2a82eb21.tony2001@phpclub.net> X-Mailer: Sylpheed version 0.9.12 (GTK+ 1.2.10; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart=_Fri__10_Sep_2004_09_56_57_+0400_E0wbbiOmIVTc_+l4" Subject: [patch] Zend/zend_execute.c - bug #27290 (warning msg on missing function argument should mention file/line of caller too) From: tony2001@phpclub.net (Antony Dovgal) --Multipart=_Fri__10_Sep_2004_09_56_57_+0400_E0wbbiOmIVTc_+l4 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Hi all. The attached patch fixes bug #27290 (which could be considered as feature request). The patch proposes to look at the previous op_code to get real line number & filename where the fuction was called. -- Wbr, Antony Dovgal aka tony2001 tony2001@phpclub.net || antony@dovgal.com --Multipart=_Fri__10_Sep_2004_09_56_57_+0400_E0wbbiOmIVTc_+l4 Content-Type: text/plain; name="bug27290.diff.txt" Content-Disposition: attachment; filename="bug27290.diff.txt" Content-Transfer-Encoding: 7bit Index: zend_execute.c =================================================================== RCS file: /repository/ZendEngine2/zend_execute.c,v retrieving revision 1.673 diff -u -r1.673 zend_execute.c --- zend_execute.c 9 Sep 2004 16:47:22 -0000 1.673 +++ zend_execute.c 10 Sep 2004 05:34:37 -0000 @@ -3371,8 +3371,18 @@ 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_execute_data *ptr = EG(current_execute_data); + + ptr = ptr->prev_execute_data; + zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, NULL TSRMLS_CC); - 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 (ptr && ptr->op_array) { + zend_error(E_WARNING, "Missing argument %ld for %s%s%s(), called in %s on line %d and defined", opline->op1.u.constant.value.lval, class_name, space, get_active_function_name(TSRMLS_C), ptr->op_array->filename, ptr->opline->lineno); + } + else { + 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_FREE(*EX_T(opline->result.u.var).var.ptr_ptr); } --Multipart=_Fri__10_Sep_2004_09_56_57_+0400_E0wbbiOmIVTc_+l4--