logo       

cvs: ZendEngine2(PHP_5_0) / zend_compile.c zend_compile.h zend_execute.c /: msg#00144

Subject: cvs: ZendEngine2(PHP_5_0) / zend_compile.c zend_compile.h zend_execute.c /tests bug33257.phpt
dmitry          Wed Jun 22 04:31:02 2005 EDT

  Added files:                 (Branch: PHP_5_0)
    /ZendEngine2/tests  bug33257.phpt 

  Modified files:              
    /ZendEngine2        zend_compile.c zend_compile.h zend_execute.c 
  Log:
  Fixed bug #33257 (array_splice() inconsistent when passed function instead of 
variable)
  
  
http://cvs.php.net/diff.php/ZendEngine2/zend_compile.c?r1=1.567.2.26&r2=1.567.2.27&ty=u
Index: ZendEngine2/zend_compile.c
diff -u ZendEngine2/zend_compile.c:1.567.2.26 
ZendEngine2/zend_compile.c:1.567.2.27
--- ZendEngine2/zend_compile.c:1.567.2.26       Tue Jun 21 08:05:23 2005
+++ ZendEngine2/zend_compile.c  Wed Jun 22 04:30:57 2005
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: zend_compile.c,v 1.567.2.26 2005/06/21 12:05:23 dmitry Exp $ */
+/* $Id: zend_compile.c,v 1.567.2.27 2005/06/22 08:30:57 dmitry Exp $ */
 
 #include <zend_language_parser.h>
 #include "zend.h"
@@ -1379,6 +1379,7 @@
        int original_op=op;
        zend_function **function_ptr_ptr, *function_ptr;
        int send_by_reference;
+       int send_function = 0;
                        
        zend_stack_top(&CG(function_call_stack), (void **) &function_ptr_ptr);
        function_ptr = *function_ptr_ptr;
@@ -1403,6 +1404,7 @@
        if (op == ZEND_SEND_VAR && zend_is_function_or_method_call(param)) {
                /* Method call */
                op = ZEND_SEND_VAR_NO_REF;
+               send_function = ZEND_ARG_SEND_FUNCTION;
        } else if (op == ZEND_SEND_VAL && param->op_type == IS_VAR) {
                op = ZEND_SEND_VAR_NO_REF;
        }
@@ -1441,9 +1443,9 @@
 
        if (op == ZEND_SEND_VAR_NO_REF) {
                if (function_ptr) {
-                       opline->extended_value = ZEND_ARG_COMPILE_TIME_BOUND | 
send_by_reference;
+                       opline->extended_value = ZEND_ARG_COMPILE_TIME_BOUND | 
send_by_reference | send_function;
                } else {
-                       opline->extended_value = 0;
+                       opline->extended_value = send_function;
                }
        } else {
                if (function_ptr) {
http://cvs.php.net/diff.php/ZendEngine2/zend_compile.h?r1=1.284.2.4&r2=1.284.2.5&ty=u
Index: ZendEngine2/zend_compile.h
diff -u ZendEngine2/zend_compile.h:1.284.2.4 
ZendEngine2/zend_compile.h:1.284.2.5
--- ZendEngine2/zend_compile.h:1.284.2.4        Thu Jun  9 12:59:56 2005
+++ ZendEngine2/zend_compile.h  Wed Jun 22 04:30:58 2005
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: zend_compile.h,v 1.284.2.4 2005/06/09 16:59:56 stas Exp $ */
+/* $Id: zend_compile.h,v 1.284.2.5 2005/06/22 08:30:58 dmitry Exp $ */
 
 #ifndef ZEND_COMPILE_H
 #define ZEND_COMPILE_H
@@ -804,6 +804,7 @@
 
 #define ZEND_ARG_SEND_BY_REF (1<<0)
 #define ZEND_ARG_COMPILE_TIME_BOUND (1<<1)
+#define ZEND_ARG_SEND_FUNCTION (1<<2)
 
 #define AI_USE_PTR(ai) \
        if ((ai).ptr_ptr) { \
http://cvs.php.net/diff.php/ZendEngine2/zend_execute.c?r1=1.652.2.38&r2=1.652.2.39&ty=u
Index: ZendEngine2/zend_execute.c
diff -u ZendEngine2/zend_execute.c:1.652.2.38 
ZendEngine2/zend_execute.c:1.652.2.39
--- ZendEngine2/zend_execute.c:1.652.2.38       Wed Jun  8 14:53:39 2005
+++ ZendEngine2/zend_execute.c  Wed Jun 22 04:30:58 2005
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: zend_execute.c,v 1.652.2.38 2005/06/08 18:53:39 dmitry Exp $ */
+/* $Id: zend_execute.c,v 1.652.2.39 2005/06/22 08:30:58 dmitry Exp $ */
 
 #define ZEND_INTENSIVE_DEBUGGING 0
 
@@ -3037,7 +3037,10 @@
        } else if (!ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), 
opline->op2.u.opline_num)) {
                return 
zend_send_by_var_helper(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
        }
-       {
+       if ((opline->extended_value & ZEND_ARG_SEND_FUNCTION) &&
+           !EX_T(opline->op1.u.var).var.fcall_returned_reference) {
+               zend_error(E_ERROR, "Only variables can be passed by 
reference");
+       } else {
                zval *varptr;
                varptr = get_zval_ptr(&opline->op1, EX(Ts), &EG(free_op1), 
BP_VAR_R);
 

http://cvs.php.net/co.php/ZendEngine2/tests/bug33257.phpt?r=1.1&p=1
Index: ZendEngine2/tests/bug33257.phpt
+++ ZendEngine2/tests/bug33257.phpt



-- 
Zend Engine CVS Mailing List (http://cvs.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
science.linguis...    culture.sf.lite...    video.mplayer.c...    yellowdog.gener...    ietf.rfc822/199...    emacs.help/2002...    redhat.release....    kernel.speakup/...    java.openejb.de...    debian.devel.gt...    xfree86.newbie/...    bug-tracking.ma...    pam/2003-05/msg...    games.devel.ope...    user-groups.lin...    music.pancham/2...    network.mq.deve...    web.html.genera...    arklinux.bugs/2...    linux.ecasound/...    qnx.openqnx.dev...    org.user-groups...    file-systems.sf...    trustix.contrib...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe