cvs: ZendEngine2(PHP_5_2) / zend_compile.c /tests bug41117_1.phpt php-src NEWS
| From: | Dmitry Stogov | Date: | Wed, 02 May 2007 13:21:55 +0000 |
| Subject: | cvs: ZendEngine2(PHP_5_2) / zend_compile.c /tests bug41117_1.phpt php-src NEWS | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-5764@lists.php.net to get a copy of this message | ||
dmitry Wed May 2 13:21:55 2007 UTC
Added files: (Branch: PHP_5_2)
/ZendEngine2/tests bug41117_1.phpt
Modified files:
/php-src NEWS
/ZendEngine2 zend_compile.c
Log:
Fixed altering $this via argument named "this"
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.671&r2=1.2027.2.547.2.672&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.671 php-src/NEWS:1.2027.2.547.2.672
--- php-src/NEWS:1.2027.2.547.2.671 Wed May 2 10:16:34 2007
+++ php-src/NEWS Wed May 2 13:21:54 2007
@@ -1,6 +1,7 @@
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? Apr 2007, PHP 5.2.3RC3
+- Fixed altering $this via argument named "this". (Dmitry)
- Fixed iterator_apply() with a callback using __call(). (Johannes)
- Fixed bug #41215 (setAttribute return code reversed). (Ilia)
- Fixed bug #41192 (Per Directory Values only work for one key). (Dmitry)
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_compile.c?r1=1.647.2.27.2.35&r2=1.647.2.27.2.36&diff_format=u
Index: ZendEngine2/zend_compile.c
diff -u ZendEngine2/zend_compile.c:1.647.2.27.2.35 ZendEngine2/zend_compile.c:1.647.2.27.2.36
--- ZendEngine2/zend_compile.c:1.647.2.27.2.35 Mon Apr 16 08:09:54 2007
+++ ZendEngine2/zend_compile.c Wed May 2 13:21:54 2007
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_compile.c,v 1.647.2.27.2.35 2007/04/16 08:09:54 dmitry Exp $ */
+/* $Id: zend_compile.c,v 1.647.2.27.2.36 2007/05/02 13:21:54 dmitry Exp $ */
#include <zend_language_parser.h>
#include "zend.h"
@@ -1265,9 +1265,18 @@
void zend_do_receive_arg(zend_uchar op, znode *var, znode *offset, znode *initialization, znode
*class_type, znode *varname, zend_uchar pass_by_reference TSRMLS_DC)
{
- zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
+ zend_op *opline;
zend_arg_info *cur_arg_info;
+ if (CG(active_op_array)->scope &&
+ ((CG(active_op_array)->fn_flags & ZEND_ACC_STATIC) == 0) &&
+ (Z_TYPE(varname->u.constant) == IS_STRING) &&
+ (Z_STRLEN(varname->u.constant) == sizeof("this")-1) &&
+ (memcmp(Z_STRVAL(varname->u.constant), "this", sizeof("this")) == 0)) {
+ zend_error(E_COMPILE_ERROR, "Cannot re-assign $this");
+ }
+
+ opline = get_next_op(CG(active_op_array) TSRMLS_CC);
CG(active_op_array)->num_args++;
opline->opcode = op;
opline->result = *var;
http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug41117_1.phpt?view=markup&rev=1.1
Index: ZendEngine2/tests/bug41117_1.phpt
+++ ZendEngine2/tests/bug41117_1.phpt