From ff766c1de20dc1e6debcb3bced82c890172bf134 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Tue, 28 Jul 2009 12:35:27 +0000 Subject: [PATCH] Fixed bug #48912 (Namespace causes unexpected strict behaviour with extract()) --- NEWS | 2 ++ Zend/tests/bug48912.phpt | 16 ++++++++++++++++ Zend/zend_vm_def.h | 4 +++- Zend/zend_vm_execute.h | 8 ++++++-- 4 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 Zend/tests/bug48912.phpt diff --git a/NEWS b/NEWS index 4f12eeccfa..81280830a1 100644 --- a/NEWS +++ b/NEWS @@ -27,6 +27,8 @@ (Ilia) - Fixed bug #48929 (Double \r\n after HTTP headers when "header" context option is an array). (David Zülke) +- Fixed bug #48912 (Namespace causes unexpected strict behaviour with + extract()). (Dmitry) - Fixed bug #48899 (is_callable returns true even if method does not exist in parent class). (Felipe) - Fixed bug #48893 (Problems compiling with Curl). (Felipe) diff --git a/Zend/tests/bug48912.phpt b/Zend/tests/bug48912.phpt new file mode 100644 index 0000000000..dc021a2efc --- /dev/null +++ b/Zend/tests/bug48912.phpt @@ -0,0 +1,16 @@ +--TEST-- +Bug #48912 (Namespace causes unexpected strict behaviour with extract()) +--FILE-- + 1)); +echo "ok\n"; +?> +--EXPECT-- +ok diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index 233574d2aa..dbf5e3af69 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -2662,7 +2662,9 @@ ZEND_VM_HANDLER(106, ZEND_SEND_VAR_NO_REF, VAR|CV, ANY) } else { zval *valptr; - if (!(opline->extended_value & ZEND_ARG_SEND_SILENT)) { + if ((opline->extended_value & ZEND_ARG_COMPILE_TIME_BOUND) ? + !(opline->extended_value & ZEND_ARG_SEND_SILENT) : + !ARG_MAY_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) { zend_error(E_STRICT, "Only variables should be passed by reference"); } ALLOC_ZVAL(valptr); diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index 2c3e7875a4..43bc3abde5 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -8278,7 +8278,9 @@ static int ZEND_FASTCALL ZEND_SEND_VAR_NO_REF_SPEC_VAR_HANDLER(ZEND_OPCODE_HAND } else { zval *valptr; - if (!(opline->extended_value & ZEND_ARG_SEND_SILENT)) { + if ((opline->extended_value & ZEND_ARG_COMPILE_TIME_BOUND) ? + !(opline->extended_value & ZEND_ARG_SEND_SILENT) : + !ARG_MAY_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) { zend_error(E_STRICT, "Only variables should be passed by reference"); } ALLOC_ZVAL(valptr); @@ -22128,7 +22130,9 @@ static int ZEND_FASTCALL ZEND_SEND_VAR_NO_REF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDL } else { zval *valptr; - if (!(opline->extended_value & ZEND_ARG_SEND_SILENT)) { + if ((opline->extended_value & ZEND_ARG_COMPILE_TIME_BOUND) ? + !(opline->extended_value & ZEND_ARG_SEND_SILENT) : + !ARG_MAY_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) { zend_error(E_STRICT, "Only variables should be passed by reference"); } ALLOC_ZVAL(valptr); -- 2.40.0