diff options
author | Andi Gutmans <andi@php.net> | 1999-04-15 17:41:21 +0000 |
---|---|---|
committer | Andi Gutmans <andi@php.net> | 1999-04-15 17:41:21 +0000 |
commit | 3d631c4ca07afdb9780c76ea8d805d679082e7a9 (patch) | |
tree | 4e41f0e280c99d344fa06c0ee65b9ec7f27cd0e9 | |
parent | fa76f0c903256f515dc946cf8f2d8d86f104d6fe (diff) | |
download | php-git-3d631c4ca07afdb9780c76ea8d805d679082e7a9.tar.gz |
- Should fix the pass by reference problem. This happened because we moved
start from arg 1 now and not arg 0. There might be more places which need fixing
like in the executor but the bug seems OK now.
-rw-r--r-- | Zend/zend_compile.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index c7c6d842de..9ce269104f 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -657,15 +657,15 @@ void do_receive_arg(int op, znode *var, znode *offset, znode *initialization, un if (pass_type==BYREF_FORCE && !CG(active_op_array)->arg_types) { int i; - CG(active_op_array)->arg_types = (unsigned char *) emalloc(sizeof(unsigned char)*(offset->u.constant.value.lval+2)); - for (i=1; i<=offset->u.constant.value.lval; i++) { + CG(active_op_array)->arg_types = (unsigned char *) emalloc(sizeof(unsigned char)*(offset->u.constant.value.lval+1)); + for (i=1; i<offset->u.constant.value.lval; i++) { CG(active_op_array)->arg_types[i] = BYREF_NONE; } CG(active_op_array)->arg_types[0]=(unsigned char) offset->u.constant.value.lval; } if (CG(active_op_array)->arg_types) { - CG(active_op_array)->arg_types = (unsigned char *) erealloc(CG(active_op_array)->arg_types, sizeof(unsigned char)*(offset->u.constant.value.lval+2)); - CG(active_op_array)->arg_types[offset->u.constant.value.lval+1] = pass_type; + CG(active_op_array)->arg_types = (unsigned char *) erealloc(CG(active_op_array)->arg_types, sizeof(unsigned char)*(offset->u.constant.value.lval+1)); + CG(active_op_array)->arg_types[offset->u.constant.value.lval] = pass_type; CG(active_op_array)->arg_types[0]++; } } |