cvs: ZendEngine2(PHP_5_1) / zend_execute_API.c zend_vm_def.h zend_vm_execute.h zend_vm_opcodes.h /tests unset_cv12.phpt

From: Date: Thu, 27 Oct 2005 19:25:58 +0000
Subject: cvs: ZendEngine2(PHP_5_1) / zend_execute_API.c zend_vm_def.h zend_vm_execute.h zend_vm_opcodes.h /tests unset_cv12.phpt
Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-4286@lists.php.net to get a copy of this message
dmitry Thu Oct 27 15:25:58 2005 EDT Added files: (Branch: PHP_5_1) /ZendEngine2/tests unset_cv12.phpt Modified files: /ZendEngine2 zend_execute_API.c zend_vm_def.h zend_vm_execute.h zend_vm_opcodes.h Log: Fixed SIGSEGV

http://cvs.php.net/diff.php/ZendEngine2/zend_execute_API.c?r1=1.331.2.3&r2=1.331.2.4&ty=u Index: ZendEngine2/zend_execute_API.c diff -u ZendEngine2/zend_execute_API.c:1.331.2.3 ZendEngine2/zend_execute_API.c:1.331.2.4 --- ZendEngine2/zend_execute_API.c:1.331.2.3 Thu Oct 20 04:14:58 2005 +++ ZendEngine2/zend_execute_API.c Thu Oct 27 15:25:48 2005 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_execute_API.c,v 1.331.2.3 2005/10/20 08:14:58 dmitry Exp $ */ +/* $Id: zend_execute_API.c,v 1.331.2.4 2005/10/27 19:25:48 dmitry Exp $ */ #include <stdio.h> #include <signal.h> @@ -1436,7 +1436,7 @@ int i; for (ex = EG(current_execute_data); ex; ex = ex->prev_execute_data) { - if (ex->symbol_table == symbol_table) { + if (ex->op_array && ex->symbol_table == symbol_table) { for (i = 0; i < ex->op_array->last_var; i++) { ex->CVs[i] = NULL; } @@ -1451,7 +1451,7 @@ if (zend_hash_quick_exists(&EG(symbol_table), name, name_len+1, hash_value)) { for (ex = EG(current_execute_data); ex; ex = ex->prev_execute_data) { - if (ex->symbol_table == &EG(symbol_table)) { + if (ex->op_array && ex->symbol_table == &EG(symbol_table)) { int i; for (i = 0; i < ex->op_array->last_var; i++) { if (ex->op_array->vars[i].hash_value == hash_value && http://cvs.php.net/diff.php/ZendEngine2/zend_vm_def.h?r1=1.59.2.16&r2=1.59.2.17&ty=u Index: ZendEngine2/zend_vm_def.h diff -u ZendEngine2/zend_vm_def.h:1.59.2.16 ZendEngine2/zend_vm_def.h:1.59.2.17 --- ZendEngine2/zend_vm_def.h:1.59.2.16 Thu Oct 20 07:31:39 2005 +++ ZendEngine2/zend_vm_def.h Thu Oct 27 15:25:48 2005 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_vm_def.h,v 1.59.2.16 2005/10/20 11:31:39 dmitry Exp $ */ +/* $Id: zend_vm_def.h,v 1.59.2.17 2005/10/27 19:25:48 dmitry Exp $ */ /* If you change this file, please regenerate the zend_vm_execute.h and * zend_vm_opcodes.h files by running: @@ -2813,12 +2813,14 @@ do { int i; - for (i = 0; i < ex->op_array->last_var; i++) { - if (ex->op_array->vars[i].hash_value == hash_value && - ex->op_array->vars[i].name_len == varname->value.str.len && - !memcmp(ex->op_array->vars[i].name, varname->value.str.val, varname->value.str.len)) { - ex->CVs[i] = NULL; - break; + if (ex->op_array) { + for (i = 0; i < ex->op_array->last_var; i++) { + if (ex->op_array->vars[i].hash_value == hash_value && + ex->op_array->vars[i].name_len == varname->value.str.len && + !memcmp(ex->op_array->vars[i].name, varname->value.str.val, varname->value.str.len)) { + ex->CVs[i] = NULL; + break; + } } } ex = ex->prev_execute_data; @@ -2869,7 +2871,7 @@ ulong hash_value = zend_inline_hash_func(offset->value.str.val, offset->value.str.len+1); for (ex = EXECUTE_DATA; ex; ex = ex->prev_execute_data) { - if (ex->symbol_table == ht) { + if (ex->op_array && ex->symbol_table == ht) { int i; for (i = 0; i < ex->op_array->last_var; i++) { http://cvs.php.net/diff.php/ZendEngine2/zend_vm_execute.h?r1=1.62.2.16&r2=1.62.2.17&ty=u Index: ZendEngine2/zend_vm_execute.h diff -u ZendEngine2/zend_vm_execute.h:1.62.2.16 ZendEngine2/zend_vm_execute.h:1.62.2.17 --- ZendEngine2/zend_vm_execute.h:1.62.2.16 Thu Oct 20 07:31:39 2005 +++ ZendEngine2/zend_vm_execute.h Thu Oct 27 15:25:49 2005 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_vm_execute.h,v 1.62.2.16 2005/10/20 11:31:39 dmitry Exp $ */ +/* $Id: zend_vm_execute.h,v 1.62.2.17 2005/10/27 19:25:49 dmitry Exp $ */ static opcode_handler_t zend_user_opcode_handlers[256] = {(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL}; @@ -1987,12 +1987,14 @@ do { int i; - for (i = 0; i < ex->op_array->last_var; i++) { - if (ex->op_array->vars[i].hash_value == hash_value && - ex->op_array->vars[i].name_len == varname->value.str.len && - !memcmp(ex->op_array->vars[i].name, varname->value.str.val, varname->value.str.len)) { - ex->CVs[i] = NULL; - break; + if (ex->op_array) { + for (i = 0; i < ex->op_array->last_var; i++) { + if (ex->op_array->vars[i].hash_value == hash_value && + ex->op_array->vars[i].name_len == varname->value.str.len && + !memcmp(ex->op_array->vars[i].name, varname->value.str.val, varname->value.str.len)) { + ex->CVs[i] = NULL; + break; + } } } ex = ex->prev_execute_data; @@ -4404,12 +4406,14 @@ do { int i; - for (i = 0; i < ex->op_array->last_var; i++) { - if (ex->op_array->vars[i].hash_value == hash_value && - ex->op_array->vars[i].name_len == varname->value.str.len && - !memcmp(ex->op_array->vars[i].name, varname->value.str.val, varname->value.str.len)) { - ex->CVs[i] = NULL; - break; + if (ex->op_array) { + for (i = 0; i < ex->op_array->last_var; i++) { + if (ex->op_array->vars[i].hash_value == hash_value && + ex->op_array->vars[i].name_len == varname->value.str.len && + !memcmp(ex->op_array->vars[i].name, varname->value.str.val, varname->value.str.len)) { + ex->CVs[i] = NULL; + break; + } } } ex = ex->prev_execute_data; @@ -7402,12 +7406,14 @@ do { int i; - for (i = 0; i < ex->op_array->last_var; i++) { - if (ex->op_array->vars[i].hash_value == hash_value && - ex->op_array->vars[i].name_len == varname->value.str.len && - !memcmp(ex->op_array->vars[i].name, varname->value.str.val, varname->value.str.len)) { - ex->CVs[i] = NULL; - break; + if (ex->op_array) { + for (i = 0; i < ex->op_array->last_var; i++) { + if (ex->op_array->vars[i].hash_value == hash_value && + ex->op_array->vars[i].name_len == varname->value.str.len && + !memcmp(ex->op_array->vars[i].name, varname->value.str.val, varname->value.str.len)) { + ex->CVs[i] = NULL; + break; + } } } ex = ex->prev_execute_data; @@ -8991,7 +8997,7 @@ ulong hash_value = zend_inline_hash_func(offset->value.str.val, offset->value.str.len+1); for (ex = execute_data; ex; ex = ex->prev_execute_data) { - if (ex->symbol_table == ht) { + if (ex->op_array && ex->symbol_table == ht) { int i; for (i = 0; i < ex->op_array->last_var; i++) { @@ -10418,7 +10424,7 @@ ulong hash_value = zend_inline_hash_func(offset->value.str.val, offset->value.str.len+1); for (ex = execute_data; ex; ex = ex->prev_execute_data) { - if (ex->symbol_table == ht) { + if (ex->op_array && ex->symbol_table == ht) { int i; for (i = 0; i < ex->op_array->last_var; i++) { @@ -11883,7 +11889,7 @@ ulong hash_value = zend_inline_hash_func(offset->value.str.val, offset->value.str.len+1); for (ex = execute_data; ex; ex = ex->prev_execute_data) { - if (ex->symbol_table == ht) { + if (ex->op_array && ex->symbol_table == ht) { int i; for (i = 0; i < ex->op_array->last_var; i++) { @@ -13750,7 +13756,7 @@ ulong hash_value = zend_inline_hash_func(offset->value.str.val, offset->value.str.len+1); for (ex = execute_data; ex; ex = ex->prev_execute_data) { - if (ex->symbol_table == ht) { + if (ex->op_array && ex->symbol_table == ht) { int i; for (i = 0; i < ex->op_array->last_var; i++) { @@ -14904,7 +14910,7 @@ ulong hash_value = zend_inline_hash_func(offset->value.str.val, offset->value.str.len+1); for (ex = execute_data; ex; ex = ex->prev_execute_data) { - if (ex->symbol_table == ht) { + if (ex->op_array && ex->symbol_table == ht) { int i; for (i = 0; i < ex->op_array->last_var; i++) { @@ -15942,7 +15948,7 @@ ulong hash_value = zend_inline_hash_func(offset->value.str.val, offset->value.str.len+1); for (ex = execute_data; ex; ex = ex->prev_execute_data) { - if (ex->symbol_table == ht) { + if (ex->op_array && ex->symbol_table == ht) { int i; for (i = 0; i < ex->op_array->last_var; i++) { @@ -16980,7 +16986,7 @@ ulong hash_value = zend_inline_hash_func(offset->value.str.val, offset->value.str.len+1); for (ex = execute_data; ex; ex = ex->prev_execute_data) { - if (ex->symbol_table == ht) { + if (ex->op_array && ex->symbol_table == ht) { int i; for (i = 0; i < ex->op_array->last_var; i++) { @@ -18381,7 +18387,7 @@ ulong hash_value = zend_inline_hash_func(offset->value.str.val, offset->value.str.len+1); for (ex = execute_data; ex; ex = ex->prev_execute_data) { - if (ex->symbol_table == ht) { + if (ex->op_array && ex->symbol_table == ht) { int i; for (i = 0; i < ex->op_array->last_var; i++) { @@ -19502,12 +19508,14 @@ do { int i; - for (i = 0; i < ex->op_array->last_var; i++) { - if (ex->op_array->vars[i].hash_value == hash_value && - ex->op_array->vars[i].name_len == varname->value.str.len && - !memcmp(ex->op_array->vars[i].name, varname->value.str.val, varname->value.str.len)) { - ex->CVs[i] = NULL; - break; + if (ex->op_array) { + for (i = 0; i < ex->op_array->last_var; i++) { + if (ex->op_array->vars[i].hash_value == hash_value && + ex->op_array->vars[i].name_len == varname->value.str.len && + !memcmp(ex->op_array->vars[i].name, varname->value.str.val, varname->value.str.len)) { + ex->CVs[i] = NULL; + break; + } } } ex = ex->prev_execute_data; @@ -20943,7 +20951,7 @@ ulong hash_value = zend_inline_hash_func(offset->value.str.val, offset->value.str.len+1); for (ex = execute_data; ex; ex = ex->prev_execute_data) { - if (ex->symbol_table == ht) { + if (ex->op_array && ex->symbol_table == ht) { int i; for (i = 0; i < ex->op_array->last_var; i++) { @@ -22362,7 +22370,7 @@ ulong hash_value = zend_inline_hash_func(offset->value.str.val, offset->value.str.len+1); for (ex = execute_data; ex; ex = ex->prev_execute_data) { - if (ex->symbol_table == ht) { + if (ex->op_array && ex->symbol_table == ht) { int i; for (i = 0; i < ex->op_array->last_var; i++) { @@ -23818,7 +23826,7 @@ ulong hash_value = zend_inline_hash_func(offset->value.str.val, offset->value.str.len+1); for (ex = execute_data; ex; ex = ex->prev_execute_data) { - if (ex->symbol_table == ht) { + if (ex->op_array && ex->symbol_table == ht) { int i; for (i = 0; i < ex->op_array->last_var; i++) { @@ -25675,7 +25683,7 @@ ulong hash_value = zend_inline_hash_func(offset->value.str.val, offset->value.str.len+1); for (ex = execute_data; ex; ex = ex->prev_execute_data) { - if (ex->symbol_table == ht) { + if (ex->op_array && ex->symbol_table == ht) { int i; for (i = 0; i < ex->op_array->last_var; i++) { http://cvs.php.net/diff.php/ZendEngine2/zend_vm_opcodes.h?r1=1.42.2.14&r2=1.42.2.15&ty=u Index: ZendEngine2/zend_vm_opcodes.h diff -u ZendEngine2/zend_vm_opcodes.h:1.42.2.14 ZendEngine2/zend_vm_opcodes.h:1.42.2.15 --- ZendEngine2/zend_vm_opcodes.h:1.42.2.14 Thu Oct 20 07:31:41 2005 +++ ZendEngine2/zend_vm_opcodes.h Thu Oct 27 15:25:52 2005 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_vm_opcodes.h,v 1.42.2.14 2005/10/20 11:31:41 dmitry Exp $ */ +/* $Id: zend_vm_opcodes.h,v 1.42.2.15 2005/10/27 19:25:52 dmitry Exp $ */ #define ZEND_NOP 0 #define ZEND_ADD 1 http://cvs.php.net/co.php/ZendEngine2/tests/unset_cv12.phpt?r=1.1&p=1 Index: ZendEngine2/tests/unset_cv12.phpt +++ ZendEngine2/tests/unset_cv12.phpt --TEST-- unset() CV 12 (unset() in indirect called function) --FILE-- <?php $x = 1; function foo() {unset($GLOBALS["x"]);} call_user_func("foo"); echo "ok\n"; ?> --EXPECT-- ok
« previous php.zend-engine.cvs (#4286) next »