cvs: ZendEngine2 / zend_execute.c zend_execute.h
| From: | Andi Gutmans | Date: | Mon, 19 Jan 2004 12:22:02 +0000 |
| Subject: | cvs: ZendEngine2 / zend_execute.c zend_execute.h | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-2238@lists.php.net to get a copy of this message | ||
andi Mon Jan 19 07:22:02 2004 EDT
Modified files:
/ZendEngine2 zend_execute.c zend_execute.h
Log:
- Hopefully fix bug #26696.
- Please let me know if hell-breaks loose
http://cvs.php.net/diff.php/ZendEngine2/zend_execute.c?r1=1.583&r2=1.584&ty=u
Index: ZendEngine2/zend_execute.c
diff -u ZendEngine2/zend_execute.c:1.583 ZendEngine2/zend_execute.c:1.584
--- ZendEngine2/zend_execute.c:1.583 Fri Jan 9 08:52:19 2004
+++ ZendEngine2/zend_execute.c Mon Jan 19 07:22:02 2004
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_execute.c,v 1.583 2004/01/09 13:52:19 stas Exp $ */
+/* $Id: zend_execute.c,v 1.584 2004/01/19 12:22:02 andi Exp $ */
#define ZEND_INTENSIVE_DEBUGGING 0
@@ -99,19 +99,19 @@
return T(node->u.var).var.ptr;
} else {
temp_variable *T = &T(node->u.var);
- zval *str = T->var.str_offset.str;
+ zval *str = T->str_offset.str;
/* string offset */
*should_free = &T(node->u.var).tmp_var;
- if (T->var.str_offset.str->type != IS_STRING
- || ((int)T->var.str_offset.offset<0)
- || (T->var.str_offset.str->value.str.len <= T->var.str_offset.offset)) {
- zend_error(E_NOTICE, "Uninitialized string offset: %d",
T->var.str_offset.offset);
+ if (T->str_offset.str->type != IS_STRING
+ || ((int)T->str_offset.offset<0)
+ || (T->str_offset.str->value.str.len <= T->str_offset.offset)) {
+ zend_error(E_NOTICE, "Uninitialized string offset: %d", T->str_offset.offset);
T->tmp_var.value.str.val = empty_string;
T->tmp_var.value.str.len = 0;
} else {
- char c = str->value.str.val[T->var.str_offset.offset];
+ char c = str->value.str.val[T->str_offset.offset];
T->tmp_var.value.str.val = estrndup(&c, 1);
T->tmp_var.value.str.len = 1;
@@ -139,7 +139,7 @@
PZVAL_UNLOCK(*T(node->u.var).var.ptr_ptr);
} else {
/* string offset */
- PZVAL_UNLOCK(T(node->u.var).var.str_offset.str);
+ PZVAL_UNLOCK(T(node->u.var).str_offset.str);
}
return T(node->u.var).var.ptr_ptr;
} else {
@@ -199,7 +199,7 @@
/* perform the equivalent of equivalent of a
* quick & silent get_zval_ptr, and FREE_OP
*/
- PZVAL_UNLOCK(T->var.str_offset.str);
+ PZVAL_UNLOCK(T->str_offset.str);
} else {
zval_ptr_dtor(&T(opline->op1.u.var).var.ptr);
if (opline->extended_value) { /* foreach() free */
@@ -440,28 +440,28 @@
if (!variable_ptr_ptr) {
temp_variable *T = &T(op1->u.var);
- if (T->var.str_offset.str->type == IS_STRING) do {
+ if (T->str_offset.str->type == IS_STRING) do {
zval tmp;
zval *final_value = value;
- if (((int)T->var.str_offset.offset < 0)) {
- zend_error(E_WARNING, "Illegal string offset: %d", T->var.str_offset.offset);
+ if (((int)T->str_offset.offset < 0)) {
+ zend_error(E_WARNING, "Illegal string offset: %d", T->str_offset.offset);
break;
}
- if (T->var.str_offset.offset >= T->var.str_offset.str->value.str.len) {
+ if (T->str_offset.offset >= T->str_offset.str->value.str.len) {
zend_uint i;
- if (T->var.str_offset.str->value.str.len==0) {
- STR_FREE(T->var.str_offset.str->value.str.val);
- T->var.str_offset.str->value.str.val = (char *)
emalloc(T->var.str_offset.offset+1+1);
+ if (T->str_offset.str->value.str.len==0) {
+ STR_FREE(T->str_offset.str->value.str.val);
+ T->str_offset.str->value.str.val = (char *) emalloc(T->str_offset.offset+1+1);
} else {
- T->var.str_offset.str->value.str.val = (char *)
erealloc(T->var.str_offset.str->value.str.val, T->var.str_offset.offset+1+1);
+ T->str_offset.str->value.str.val = (char *)
erealloc(T->str_offset.str->value.str.val, T->str_offset.offset+1+1);
}
- for (i=T->var.str_offset.str->value.str.len; i<T->var.str_offset.offset; i++) {
- T->var.str_offset.str->value.str.val[i] = ' ';
+ for (i=T->str_offset.str->value.str.len; i<T->str_offset.offset; i++) {
+ T->str_offset.str->value.str.val[i] = ' ';
}
- T->var.str_offset.str->value.str.val[T->var.str_offset.offset+1] = 0;
- T->var.str_offset.str->value.str.len = T->var.str_offset.offset+1;
+ T->str_offset.str->value.str.val[T->str_offset.offset+1] = 0;
+ T->str_offset.str->value.str.len = T->str_offset.offset+1;
}
if (value->type!=IS_STRING) {
@@ -473,7 +473,7 @@
final_value = &tmp;
}
- T->var.str_offset.str->value.str.val[T->var.str_offset.offset] =
final_value->value.str.val[0];
+ T->str_offset.str->value.str.val[T->str_offset.offset] =
final_value->value.str.val[0];
if (op2) {
if (op2->op_type == IS_VAR) {
@@ -503,10 +503,10 @@
}
/*
* the value of an assignment to a string offset is undefined
- T(result->u.var).var = &T->var.str_offset.str;
+ T(result->u.var).var = &T->str_offset.str;
*/
} while (0);
- /* zval_ptr_dtor(&T->var.str_offset.str); Nuke this line if it doesn't cause a leak
*/
+ /* zval_ptr_dtor(&T->str_offset.str); Nuke this line if it doesn't cause a leak */
T->tmp_var.type = IS_STRING;
/* T(result->u.var).var.ptr_ptr = &EG(uninitialized_zval_ptr); */
@@ -902,9 +902,9 @@
SEPARATE_ZVAL_IF_NOT_REF(container_ptr);
}
container = *container_ptr;
- T(result->u.var).var.str_offset.str = container;
+ T(result->u.var).str_offset.str = container;
PZVAL_LOCK(container);
- T(result->u.var).var.str_offset.offset = offset->value.lval;
+ T(result->u.var).str_offset.offset = offset->value.lval;
FREE_OP(Ts, op2, EG(free_op2));
*retval = NULL;
return;
@@ -3049,7 +3049,7 @@
PZVAL_LOCK(EX_T(EX(opline)->op1.u.var).var.ptr);
} else {
switch_expr_is_overloaded = 1;
- EX_T(EX(opline)->op1.u.var).var.str_offset.str->refcount++;
+ EX_T(EX(opline)->op1.u.var).str_offset.str->refcount++;
}
}
is_equal_function(&EX_T(EX(opline)->result.u.var).tmp_var,
http://cvs.php.net/diff.php/ZendEngine2/zend_execute.h?r1=1.62&r2=1.63&ty=u
Index: ZendEngine2/zend_execute.h
diff -u ZendEngine2/zend_execute.h:1.62 ZendEngine2/zend_execute.h:1.63
--- ZendEngine2/zend_execute.h:1.62 Sun Jan 18 18:42:47 2004
+++ ZendEngine2/zend_execute.h Mon Jan 19 07:22:02 2004
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_execute.h,v 1.62 2004/01/18 23:42:47 helly Exp $ */
+/* $Id: zend_execute.h,v 1.63 2004/01/19 12:22:02 andi Exp $ */
#ifndef ZEND_EXECUTE_H
#define ZEND_EXECUTE_H
@@ -32,12 +32,13 @@
struct {
zval **ptr_ptr;
zval *ptr;
- struct {
- zval *str;
- zend_uint offset;
- } str_offset;
zend_bool fcall_returned_reference;
} var;
+ struct {
+ zval tmp_var;
+ zval *str;
+ zend_uint offset;
+ } str_offset;
zend_class_entry *class_entry;
} temp_variable;