cvs: ZendEngine2 / zend_vm_def.h zend_vm_execute.h /tests bug35470.phpt
| From: | Dmitry Stogov | Date: | Wed, 30 Nov 2005 10:10:33 +0000 |
| Subject: | cvs: ZendEngine2 / zend_vm_def.h zend_vm_execute.h /tests bug35470.phpt | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-4402@lists.php.net to get a copy of this message | ||
dmitry Wed Nov 30 05:10:33 2005 EDT
Modified files:
/ZendEngine2 zend_vm_def.h zend_vm_execute.h
/ZendEngine2/tests bug35470.phpt
Log:
Fixed bug #35470 (Assigning global using variable name from array doesn't function)
http://cvs.php.net/diff.php/ZendEngine2/zend_vm_def.h?r1=1.88&r2=1.89&ty=u
Index: ZendEngine2/zend_vm_def.h
diff -u ZendEngine2/zend_vm_def.h:1.88 ZendEngine2/zend_vm_def.h:1.89
--- ZendEngine2/zend_vm_def.h:1.88 Mon Nov 28 09:33:22 2005
+++ ZendEngine2/zend_vm_def.h Wed Nov 30 05:10:31 2005
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_vm_def.h,v 1.88 2005/11/28 14:33:22 dmitry Exp $ */
+/* $Id: zend_vm_def.h,v 1.89 2005/11/30 10:10:31 dmitry Exp $ */
/* If you change this file, please regenerate the zend_vm_execute.h and
* zend_vm_opcodes.h files by running:
@@ -983,6 +983,11 @@
case ZEND_FETCH_STATIC:
zval_update_constant(retval, (void*) 1 TSRMLS_CC);
break;
+ case ZEND_FETCH_GLOBAL_LOCK:
+ if (OP1_TYPE == IS_VAR && !free_op1.var) {
+ PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr);
+ }
+ break;
}
}
http://cvs.php.net/diff.php/ZendEngine2/zend_vm_execute.h?r1=1.91&r2=1.92&ty=u
Index: ZendEngine2/zend_vm_execute.h
diff -u ZendEngine2/zend_vm_execute.h:1.91 ZendEngine2/zend_vm_execute.h:1.92
--- ZendEngine2/zend_vm_execute.h:1.91 Mon Nov 28 09:33:22 2005
+++ ZendEngine2/zend_vm_execute.h Wed Nov 30 05:10:31 2005
@@ -1308,7 +1308,7 @@
static int zend_fetch_var_address_helper_SPEC_CONST(int type, ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+ zend_free_op free_op1;
zval *varname = &opline->op1.u.constant;
zval **retval;
zval tmp_varname;
@@ -1364,6 +1364,11 @@
case ZEND_FETCH_STATIC:
zval_update_constant(retval, (void*) 1 TSRMLS_CC);
break;
+ case ZEND_FETCH_GLOBAL_LOCK:
+ if (IS_CONST == IS_VAR && !free_op1.var) {
+ PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr);
+ }
+ break;
}
}
@@ -3864,6 +3869,11 @@
case ZEND_FETCH_STATIC:
zval_update_constant(retval, (void*) 1 TSRMLS_CC);
break;
+ case ZEND_FETCH_GLOBAL_LOCK:
+ if (IS_TMP_VAR == IS_VAR && !free_op1.var) {
+ PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr);
+ }
+ break;
}
}
@@ -6871,6 +6881,11 @@
case ZEND_FETCH_STATIC:
zval_update_constant(retval, (void*) 1 TSRMLS_CC);
break;
+ case ZEND_FETCH_GLOBAL_LOCK:
+ if (IS_VAR == IS_VAR && !free_op1.var) {
+ PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr);
+ }
+ break;
}
}
@@ -19513,7 +19528,7 @@
static int zend_fetch_var_address_helper_SPEC_CV(int type, ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+ zend_free_op free_op1;
zval *varname = _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC);
zval **retval;
zval tmp_varname;
@@ -19569,6 +19584,11 @@
case ZEND_FETCH_STATIC:
zval_update_constant(retval, (void*) 1 TSRMLS_CC);
break;
+ case ZEND_FETCH_GLOBAL_LOCK:
+ if (IS_CV == IS_VAR && !free_op1.var) {
+ PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr);
+ }
+ break;
}
}
http://cvs.php.net/diff.php/ZendEngine2/tests/bug35470.phpt?r1=1.1&r2=1.2&ty=u
Index: ZendEngine2/tests/bug35470.phpt
diff -u /dev/null ZendEngine2/tests/bug35470.phpt:1.2
--- /dev/null Wed Nov 30 05:10:33 2005
+++ ZendEngine2/tests/bug35470.phpt Wed Nov 30 05:10:32 2005
@@ -0,0 +1,11 @@
+--TEST--
+Bug #35470 (Assigning global using variable name from array doesn't function)
+--FILE--
+<?php
+$x = array("test", "55");
+global ${$x[0]};
+${$x[0]} = $x[1];
+echo "Test: $test\n";;
+?>
+--EXPECT--
+Test: 55