]> granicus.if.org Git - php/commitdiff
- Revert automatic pass arg_info
authorMarcus Boerger <helly@php.net>
Fri, 8 Oct 2004 22:17:32 +0000 (22:17 +0000)
committerMarcus Boerger <helly@php.net>
Fri, 8 Oct 2004 22:17:32 +0000 (22:17 +0000)
# We need to find a better solutions to prevent havy extension writer probs

Zend/zend_compile.c
Zend/zend_compile.h
Zend/zend_vm_handlers.h

index c41309c46a8a8f7516bfc70b8cbeb049e89d0edc..f5e3fe8dc5d45b27ab2162d115a89ab862607296 100644 (file)
@@ -1454,7 +1454,7 @@ void zend_do_pass_param(znode *param, zend_uchar op, int offset TSRMLS_DC)
        }
 
        if (function_ptr) {
-               send_by_reference = ARG_SEND_TYPE(function_ptr, (zend_uint) offset);    
+               send_by_reference = ARG_SHOULD_BE_SENT_BY_REF(function_ptr, (zend_uint) offset) ? ZEND_ARG_SEND_BY_REF : 0;     
        } else {
                send_by_reference = 0;
        }
@@ -1466,7 +1466,7 @@ void zend_do_pass_param(znode *param, zend_uchar op, int offset TSRMLS_DC)
                op = ZEND_SEND_VAR_NO_REF;
        }
 
-       if (op!=ZEND_SEND_VAR_NO_REF && send_by_reference!=0) {
+       if (op!=ZEND_SEND_VAR_NO_REF && send_by_reference==ZEND_ARG_SEND_BY_REF) {
                /* change to passing by reference */
                switch (param->op_type) {
                        case IS_VAR:
@@ -1474,9 +1474,7 @@ void zend_do_pass_param(znode *param, zend_uchar op, int offset TSRMLS_DC)
                                op = ZEND_SEND_REF;
                                break;
                        default:
-                               if (send_by_reference==ZEND_ARG_SEND_BY_REF) {
-                                       zend_error(E_COMPILE_ERROR, "Only variables can be passed by reference");
-                               }
+                               zend_error(E_COMPILE_ERROR, "Only variables can be passed by reference");
                                break;
                }
        }
index e99c866ffe1a4ed7800c574d6d642ddf39cb324d..3fab70f7462764f7ac5828e3049b9b146a993faf 100644 (file)
@@ -812,7 +812,6 @@ int zendlex(znode *zendlval TSRMLS_DC);
 
 #define ZEND_ARG_SEND_BY_REF (1<<0)
 #define ZEND_ARG_COMPILE_TIME_BOUND (1<<1)
-#define ZEND_ARG_SEND_AUTOMATIC (1<<2)
 
 /* Lost In Stupid Parentheses */
 #define ARG_SHOULD_BE_SENT_BY_REF(zf, arg_num)                                                                                 \
@@ -823,24 +822,15 @@ int zendlex(znode *zendlval TSRMLS_DC);
                (                                                                                                                                                               \
                        (                                                                                                                                                       \
                                arg_num<=((zend_function *) zf)->common.num_args                                                \
-                               && ((zend_function *) zf)->common.arg_info[arg_num-1].pass_by_reference == ZEND_ARG_SEND_BY_REF \
+                               && ((zend_function *) zf)->common.arg_info[arg_num-1].pass_by_reference \
                        )                                                                                                                                                       \
                ||      (                                                                                                                                                       \
                                arg_num>((zend_function *) zf)->common.num_args                                                 \
-                               && ((zend_function *) zf)->common.pass_rest_by_reference == ZEND_ARG_SEND_BY_REF \
+                               && ((zend_function *) zf)->common.pass_rest_by_reference                                \
                        )                                                                                                                                                       \
                )                                                                                                                                                               \
        )
 
-#define ARG_SEND_TYPE(zf, arg_num)                                                                                                             \
-       (                                                                                                                                                                       \
-               !zf || !((zend_function *) zf)->common.arg_info                                                                 \
-               ? 0                                                                                                                                                             \
-               : ( arg_num<=((zend_function *) zf)->common.num_args                                                    \
-                   ? ((zend_function *) zf)->common.arg_info[arg_num-1].pass_by_reference              \
-                       : ((zend_function *) zf)->common.pass_rest_by_reference                                         \
-                 )                                                                                                                                                             \
-       )
 
 #define ZEND_RETURN_VAL 0
 #define ZEND_RETURN_REF 1
index 04b2af5bcf2351c79c51e9589faba42cd05ac228..0f2c312f124b3c7788c8b9ebaa81940b6f116db0 100644 (file)
@@ -2550,7 +2550,7 @@ ZEND_VM_HANDLER(ZEND_SEND_VAR_NO_REF)
 {
        zend_op *opline = EX(opline);
        if (opline->extended_value & ZEND_ARG_COMPILE_TIME_BOUND) { /* Had function_ptr at compile_time */
-               if (!(opline->extended_value & ZEND_ARG_SEND_BY_REF) && !(opline->extended_value & ZEND_ARG_SEND_AUTOMATIC)) {
+               if (!(opline->extended_value & ZEND_ARG_SEND_BY_REF)) {
                        ZEND_VM_DISPATCH_TO_HELPER(zend_send_by_var_helper);
                }
        } else if (!ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) {