diff options
author | Zeev Suraski <zeev@php.net> | 2000-04-29 02:56:44 +0000 |
---|---|---|
committer | Zeev Suraski <zeev@php.net> | 2000-04-29 02:56:44 +0000 |
commit | 42d15298d7649691145ac15132579ec61e131e8d (patch) | |
tree | d7f0c408559d00d42b725c66feb1dc856d285cb4 /Zend/zend_opcode.c | |
parent | e0a48fe623cffe6cae397c40f4b98113f28686cf (diff) | |
download | php-git-42d15298d7649691145ac15132579ec61e131e8d.tar.gz |
Fix possible bug with extension dtors being called without the ctors being called first
Diffstat (limited to 'Zend/zend_opcode.c')
-rw-r--r-- | Zend/zend_opcode.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Zend/zend_opcode.c b/Zend/zend_opcode.c index a0820db96b..fe768da137 100644 --- a/Zend/zend_opcode.c +++ b/Zend/zend_opcode.c @@ -98,6 +98,7 @@ void init_op_array(zend_op_array *op_array, int type, int initial_ops_size) op_array->uses_globals = 0; op_array->return_reference = 0; + op_array->done_pass_two = 0; zend_llist_apply_with_argument(&zend_extensions, (void (*)(void *, void *)) zend_extension_op_array_ctor_handler, op_array); } @@ -185,7 +186,9 @@ ZEND_API void destroy_op_array(zend_op_array *op_array) if (op_array->brk_cont_array) { efree(op_array->brk_cont_array); } - zend_llist_apply_with_argument(&zend_extensions, (void (*)(void *, void *)) zend_extension_op_array_dtor_handler, op_array); + if (op_array->done_pass_two) { + zend_llist_apply_with_argument(&zend_extensions, (void (*)(void *, void *)) zend_extension_op_array_dtor_handler, op_array); + } } @@ -300,6 +303,7 @@ int pass_two(zend_op_array *op_array) if (CG(handle_op_arrays)) { zend_llist_apply_with_argument(&zend_extensions, (void (*)(void *, void *)) zend_extension_op_array_handler, op_array); } + op_array->done_pass_two = 1; return 0; } |