cvs: ZendEngine2 / zend_compile.c

From: Date: Wed, 04 Feb 2004 13:56:41 +0000
Subject: cvs: ZendEngine2 / zend_compile.c
Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-2317@lists.php.net to get a copy of this message
zeev Wed Feb 4 08:56:41 2004 EDT Modified files: /ZendEngine2 zend_compile.c Log: -Error out when trying to re-assign $this http://cvs.php.net/diff.php/ZendEngine2/zend_compile.c?r1=1.530&r2=1.531&ty=u Index: ZendEngine2/zend_compile.c diff -u ZendEngine2/zend_compile.c:1.530 ZendEngine2/zend_compile.c:1.531 --- ZendEngine2/zend_compile.c:1.530 Wed Feb 4 06:56:07 2004 +++ ZendEngine2/zend_compile.c Wed Feb 4 08:56:41 2004 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_compile.c,v 1.530 2004/02/04 11:56:07 zeev Exp $ */ +/* $Id: zend_compile.c,v 1.531 2004/02/04 13:56:41 zeev Exp $ */ #include "zend_language_parser.h" #include "zend.h" @@ -487,6 +487,13 @@ SET_UNUSED(opline->result); *result = last_op->result; } else { + if (CG(active_class_entry) && (last_op->opcode == ZEND_FETCH_W) && (last_op->op1.op_type == IS_CONST) + && (last_op->op1.u.constant.type == IS_STRING) + && (last_op->op1.u.constant.value.str.len == (sizeof("this")-1)) + && !memcmp(last_op->op1.u.constant.value.str.val, "this", sizeof("this"))) { + zend_error(E_COMPILE_ERROR, "Cannot re-assign $this"); + } + opline->opcode = ZEND_ASSIGN; opline->op1 = *variable; opline->op2 = *value;

« previous php.zend-engine.cvs (#2317) next »