From 0291ad5fa68a3c87faba5c181d36ec2d5f6c2345 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Thu, 15 Feb 2007 10:38:28 +0000 Subject: Fixed bug #40236 (php -a function allocation eats memory) --- Zend/zend_opcode.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'Zend/zend_opcode.c') 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; } -- cgit v1.2.1