cvs: ZendEngine2 / 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:09 +0000
Subject: cvs: ZendEngine2 / 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-4285@lists.php.net to get a copy of this message
dmitry Thu Oct 27 15:25:09 2005 EDT Added files: /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.342&r2=1.343&ty=u Index: ZendEngine2/zend_execute_API.c diff -u ZendEngine2/zend_execute_API.c:1.342 ZendEngine2/zend_execute_API.c:1.343 --- ZendEngine2/zend_execute_API.c:1.342 Thu Oct 20 04:15:12 2005 +++ ZendEngine2/zend_execute_API.c Thu Oct 27 15:25:01 2005 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_execute_API.c,v 1.342 2005/10/20 08:15:12 dmitry Exp $ */ +/* $Id: zend_execute_API.c,v 1.343 2005/10/27 19:25:01 dmitry Exp $ */ #include <stdio.h> #include <signal.h> @@ -1543,7 +1543,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; } @@ -1558,7 +1558,7 @@ if (zend_u_hash_quick_exists(&EG(symbol_table), type, 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.83&r2=1.84&ty=u Index: ZendEngine2/zend_vm_def.h diff -u ZendEngine2/zend_vm_def.h:1.83 ZendEngine2/zend_vm_def.h:1.84 --- ZendEngine2/zend_vm_def.h:1.83 Thu Oct 20 07:31:57 2005 +++ ZendEngine2/zend_vm_def.h Thu Oct 27 15:25:01 2005 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_vm_def.h,v 1.83 2005/10/20 11:31:57 dmitry Exp $ */ +/* $Id: zend_vm_def.h,v 1.84 2005/10/27 19:25:01 dmitry Exp $ */ /* If you change this file, please regenerate the zend_vm_execute.h and * zend_vm_opcodes.h files by running: @@ -2871,12 +2871,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 == Z_UNILEN_P(varname) && - !memcmp(ex->op_array->vars[i].name, Z_UNIVAL_P(varname), Z_TYPE_P(varname)==IS_UNICODE?UBYTES(Z_UNILEN_P(varname)):Z_UNILEN_P(varname))) { - 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 == Z_UNILEN_P(varname) && + !memcmp(ex->op_array->vars[i].name, Z_UNIVAL_P(varname), Z_TYPE_P(varname)==IS_UNICODE?UBYTES(Z_UNILEN_P(varname)):Z_UNILEN_P(varname))) { + ex->CVs[i] = NULL; + break; + } } } ex = ex->prev_execute_data; @@ -2948,7 +2950,7 @@ ulong hash_value = zend_u_inline_hash_func(Z_TYPE_P(offset), offset_key, offset_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.86&r2=1.87&ty=u Index: ZendEngine2/zend_vm_execute.h diff -u ZendEngine2/zend_vm_execute.h:1.86 ZendEngine2/zend_vm_execute.h:1.87 --- ZendEngine2/zend_vm_execute.h:1.86 Thu Oct 20 07:31:58 2005 +++ ZendEngine2/zend_vm_execute.h Thu Oct 27 15:25:02 2005 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_vm_execute.h,v 1.86 2005/10/20 11:31:58 dmitry Exp $ */ +/* $Id: zend_vm_execute.h,v 1.87 2005/10/27 19:25:02 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}; @@ -2033,12 +2033,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 == Z_UNILEN_P(varname) && - !memcmp(ex->op_array->vars[i].name, Z_UNIVAL_P(varname), Z_TYPE_P(varname)==IS_UNICODE?UBYTES(Z_UNILEN_P(varname)):Z_UNILEN_P(varname))) { - 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 == Z_UNILEN_P(varname) && + !memcmp(ex->op_array->vars[i].name, Z_UNIVAL_P(varname), Z_TYPE_P(varname)==IS_UNICODE?UBYTES(Z_UNILEN_P(varname)):Z_UNILEN_P(varname))) { + ex->CVs[i] = NULL; + break; + } } } ex = ex->prev_execute_data; @@ -4540,12 +4542,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 == Z_UNILEN_P(varname) && - !memcmp(ex->op_array->vars[i].name, Z_UNIVAL_P(varname), Z_TYPE_P(varname)==IS_UNICODE?UBYTES(Z_UNILEN_P(varname)):Z_UNILEN_P(varname))) { - 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 == Z_UNILEN_P(varname) && + !memcmp(ex->op_array->vars[i].name, Z_UNIVAL_P(varname), Z_TYPE_P(varname)==IS_UNICODE?UBYTES(Z_UNILEN_P(varname)):Z_UNILEN_P(varname))) { + ex->CVs[i] = NULL; + break; + } } } ex = ex->prev_execute_data; @@ -7643,12 +7647,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 == Z_UNILEN_P(varname) && - !memcmp(ex->op_array->vars[i].name, Z_UNIVAL_P(varname), Z_TYPE_P(varname)==IS_UNICODE?UBYTES(Z_UNILEN_P(varname)):Z_UNILEN_P(varname))) { - 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 == Z_UNILEN_P(varname) && + !memcmp(ex->op_array->vars[i].name, Z_UNIVAL_P(varname), Z_TYPE_P(varname)==IS_UNICODE?UBYTES(Z_UNILEN_P(varname)):Z_UNILEN_P(varname))) { + ex->CVs[i] = NULL; + break; + } } } ex = ex->prev_execute_data; @@ -9310,7 +9316,7 @@ ulong hash_value = zend_u_inline_hash_func(Z_TYPE_P(offset), offset_key, offset_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++) { @@ -10799,7 +10805,7 @@ ulong hash_value = zend_u_inline_hash_func(Z_TYPE_P(offset), offset_key, offset_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++) { @@ -12326,7 +12332,7 @@ ulong hash_value = zend_u_inline_hash_func(Z_TYPE_P(offset), offset_key, offset_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++) { @@ -14257,7 +14263,7 @@ ulong hash_value = zend_u_inline_hash_func(Z_TYPE_P(offset), offset_key, offset_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++) { @@ -15475,7 +15481,7 @@ ulong hash_value = zend_u_inline_hash_func(Z_TYPE_P(offset), offset_key, offset_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++) { @@ -16575,7 +16581,7 @@ ulong hash_value = zend_u_inline_hash_func(Z_TYPE_P(offset), offset_key, offset_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++) { @@ -17675,7 +17681,7 @@ ulong hash_value = zend_u_inline_hash_func(Z_TYPE_P(offset), offset_key, offset_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++) { @@ -19140,7 +19146,7 @@ ulong hash_value = zend_u_inline_hash_func(Z_TYPE_P(offset), offset_key, offset_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++) { @@ -20338,12 +20344,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 == Z_UNILEN_P(varname) && - !memcmp(ex->op_array->vars[i].name, Z_UNIVAL_P(varname), Z_TYPE_P(varname)==IS_UNICODE?UBYTES(Z_UNILEN_P(varname)):Z_UNILEN_P(varname))) { - 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 == Z_UNILEN_P(varname) && + !memcmp(ex->op_array->vars[i].name, Z_UNIVAL_P(varname), Z_TYPE_P(varname)==IS_UNICODE?UBYTES(Z_UNILEN_P(varname)):Z_UNILEN_P(varname))) { + ex->CVs[i] = NULL; + break; + } } } ex = ex->prev_execute_data; @@ -21842,7 +21850,7 @@ ulong hash_value = zend_u_inline_hash_func(Z_TYPE_P(offset), offset_key, offset_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++) { @@ -23323,7 +23331,7 @@ ulong hash_value = zend_u_inline_hash_func(Z_TYPE_P(offset), offset_key, offset_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++) { @@ -24841,7 +24849,7 @@ ulong hash_value = zend_u_inline_hash_func(Z_TYPE_P(offset), offset_key, offset_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++) { @@ -26762,7 +26770,7 @@ ulong hash_value = zend_u_inline_hash_func(Z_TYPE_P(offset), offset_key, offset_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.63&r2=1.64&ty=u Index: ZendEngine2/zend_vm_opcodes.h diff -u ZendEngine2/zend_vm_opcodes.h:1.63 ZendEngine2/zend_vm_opcodes.h:1.64 --- ZendEngine2/zend_vm_opcodes.h:1.63 Thu Oct 20 07:31:59 2005 +++ ZendEngine2/zend_vm_opcodes.h Thu Oct 27 15:25:03 2005 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_vm_opcodes.h,v 1.63 2005/10/20 11:31:59 dmitry Exp $ */ +/* $Id: zend_vm_opcodes.h,v 1.64 2005/10/27 19:25:03 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 (#4285) next »