summaryrefslogtreecommitdiff
path: root/Zend/zend_compile.c
diff options
context:
space:
mode:
authorZeev Suraski <zeev@php.net>2000-10-29 19:16:29 +0000
committerZeev Suraski <zeev@php.net>2000-10-29 19:16:29 +0000
commitd0fbddcc2b363bb69ecc10c507f8172a47d1727b (patch)
tree1d825778334c11d1dfe2e765aa7b577dc83abed3 /Zend/zend_compile.c
parent366c16e561662096246167d5dcf959661e8994a3 (diff)
downloadphp-git-d0fbddcc2b363bb69ecc10c507f8172a47d1727b.tar.gz
Fix a corruption bug, when erroneously allowing to send non-variables by reference (several
bug-db reports seem to originate in this bug)
Diffstat (limited to 'Zend/zend_compile.c')
-rw-r--r--Zend/zend_compile.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index 84cc98411e..8c39273e98 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -942,20 +942,19 @@ void do_pass_param(znode *param, int op, int offset CLS_DC)
arg_types = NULL;
}
- if (op == ZEND_SEND_VAL) {
+ if (op==ZEND_SEND_VAL) {
switch (param->op_type) {
case IS_CONST: /* constants behave like variables when passed to functions,
* as far as reference counting is concerned. Treat them
* as if they were variables here.
*/
case IS_VAR:
- op = ZEND_SEND_VAR;
+ op = ZEND_SEND_VAR_NO_REF;
break;
}
}
-
-
- if (ARG_SHOULD_BE_SENT_BY_REF(offset, 1, arg_types)) {
+ if (op!=ZEND_SEND_VAR_NO_REF
+ && ARG_SHOULD_BE_SENT_BY_REF(offset, 1, arg_types)) {
/* change to passing by reference */
switch (param->op_type) {
case IS_VAR:
@@ -969,6 +968,7 @@ void do_pass_param(znode *param, int op, int offset CLS_DC)
if (original_op==ZEND_SEND_VAR) {
switch(op) {
+ case ZEND_SEND_VAR_NO_REF:
case ZEND_SEND_VAR:
if (function_ptr) {
do_end_variable_parse(BP_VAR_R, 0 CLS_CC);