diff options
author | Dmitry Stogov <dmitry@php.net> | 2007-02-15 10:38:28 +0000 |
---|---|---|
committer | Dmitry Stogov <dmitry@php.net> | 2007-02-15 10:38:28 +0000 |
commit | 0291ad5fa68a3c87faba5c181d36ec2d5f6c2345 (patch) | |
tree | bc8700b873fcaf642c99606b9183c07076e94ed6 /Zend/zend_opcode.c | |
parent | b997390e1d2c49c88d75c3a28572ff42fadd8d57 (diff) | |
download | php-git-0291ad5fa68a3c87faba5c181d36ec2d5f6c2345.tar.gz |
Fixed bug #40236 (php -a function allocation eats memory)
Diffstat (limited to 'Zend/zend_opcode.c')
-rw-r--r-- | Zend/zend_opcode.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Zend/zend_opcode.c b/Zend/zend_opcode.c index 8b9e1f4c42..e352deccdd 100644 --- a/Zend/zend_opcode.c +++ b/Zend/zend_opcode.c @@ -99,6 +99,8 @@ void init_op_array(zend_op_array *op_array, zend_uchar type, int initial_ops_siz op_array->start_op = NULL; + op_array->fn_flags = CG(interactive)?ZEND_ACC_INTERACTIVE:0; + zend_llist_apply_with_argument(&zend_extensions, (llist_apply_with_arg_func_t) zend_extension_op_array_ctor_handler, op_array TSRMLS_CC); } @@ -294,7 +296,7 @@ zend_op *get_next_op(zend_op_array *op_array TSRMLS_DC) zend_op *next_op; if (next_op_num >= op_array->size) { - if (CG(interactive)) { + if (op_array->fn_flags & ZEND_ACC_INTERACTIVE) { /* we messed up */ zend_printf("Ran out of opcode space!\n" "You should probably consider writing this huge script into a file!\n"); @@ -367,7 +369,7 @@ int pass_two(zend_op_array *op_array TSRMLS_DC) zend_llist_apply_with_argument(&zend_extensions, (llist_apply_with_arg_func_t) zend_extension_op_array_handler, op_array TSRMLS_CC); } - if (!CG(interactive) && op_array->size != op_array->last) { + if (!(op_array->fn_flags & ZEND_ACC_INTERACTIVE) && op_array->size != op_array->last) { op_array->opcodes = (zend_op *) erealloc(op_array->opcodes, sizeof(zend_op)*op_array->last); op_array->size = op_array->last; } |