cvs: ZendEngine2 / zend_compile.c
| From: | Andi Gutmans | Date: | Mon, 01 Jul 2002 15:13:40 +0000 |
| Subject: | cvs: ZendEngine2 / zend_compile.c | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-235@lists.php.net to get a copy of this message | ||
andi Mon Jul 1 11:13:40 2002 EDT
Modified files:
/ZendEngine2 zend_compile.c
Log:
- Fix bug when acccessing $this not in class scope.
Index: ZendEngine2/zend_compile.c
diff -u ZendEngine2/zend_compile.c:1.290 ZendEngine2/zend_compile.c:1.291
--- ZendEngine2/zend_compile.c:1.290 Sat Jun 29 07:24:11 2002
+++ ZendEngine2/zend_compile.c Mon Jul 1 11:13:39 2002
@@ -2216,17 +2216,18 @@
SET_UNUSED(opline_ptr->op2);
opline_ptr->op2.u.EA.type = ZEND_FETCH_FROM_THIS;
- if ((opline_ptr->op1.op_type == IS_CONST) &&
zend_hash_exists(&CG(active_class_entry)->private_properties,
opline_ptr->op1.u.constant.value.str.val, opline_ptr->op1.u.constant.value.str.len+1)) {
- char *priv_name;
- int priv_name_length;
+ if (CG(active_class_entry)) {
+ if ((opline_ptr->op1.op_type == IS_CONST) &&
zend_hash_exists(&CG(active_class_entry)->private_properties,
opline_ptr->op1.u.constant.value.str.val, opline_ptr->op1.u.constant.value.str.len+1)) {
+ char *priv_name;
+ int priv_name_length;
- mangle_private_property_name(&priv_name, &priv_name_length,
CG(active_class_entry)->name, CG(active_class_entry)->name_length,
opline_ptr->op1.u.constant.value.str.val, opline_ptr->op1.u.constant.value.str.len);
+ mangle_private_property_name(&priv_name, &priv_name_length,
CG(active_class_entry)->name, CG(active_class_entry)->name_length,
opline_ptr->op1.u.constant.value.str.val, opline_ptr->op1.u.constant.value.str.len);
- STR_FREE(opline_ptr->op1.u.constant.value.str.val);
- opline_ptr->op1.u.constant.value.str.val = priv_name;
- opline_ptr->op1.u.constant.value.str.len = priv_name_length;
+ STR_FREE(opline_ptr->op1.u.constant.value.str.val);
+ opline_ptr->op1.u.constant.value.str.val = priv_name;
+ opline_ptr->op1.u.constant.value.str.len = priv_name_length;
+ }
}
-
*result = opline_ptr->result;
return;
}