diff options
| author | Andi Gutmans <andi@php.net> | 2001-04-30 04:50:34 +0000 |
|---|---|---|
| committer | Andi Gutmans <andi@php.net> | 2001-04-30 04:50:34 +0000 |
| commit | ce7d0ef0904bf514946656b5a3133bda5d6cce27 (patch) | |
| tree | dfa1ca1dd5656658b18601b87432b271dc403681 /Zend/zend_execute_API.c | |
| parent | 34f03f2c5cce5b668bfaa1ec04ef8d2f1e9c33a1 (diff) | |
| download | php-git-ce7d0ef0904bf514946656b5a3133bda5d6cce27.tar.gz | |
- Fix crash bug in interactive mode
Diffstat (limited to 'Zend/zend_execute_API.c')
| -rw-r--r-- | Zend/zend_execute_API.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index 5a71c660c1..1757d8bfb1 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -557,6 +557,7 @@ ZEND_API int zend_eval_string(char *str, zval *retval_ptr, char *string_name CLS #if SUPPORT_INTERACTIVE void execute_new_code(CLS_D) { + zend_op *opline, *end; ELS_FETCH(); if (!EG(interactive) @@ -565,6 +566,22 @@ void execute_new_code(CLS_D) || CG(active_op_array)->type!=ZEND_USER_FUNCTION) { return; } + + opline=CG(active_op_array)->opcodes + CG(active_op_array)->start_op_number; + end=opline+CG(active_op_array)->last; + + while (opline<end) { + if (opline->op1.op_type==IS_CONST) { + opline->op1.u.constant.is_ref = 1; + opline->op1.u.constant.refcount = 2; /* Make sure is_ref won't be reset */ + } + if (opline->op2.op_type==IS_CONST) { + opline->op2.u.constant.is_ref = 1; + opline->op2.u.constant.refcount = 2; + } + opline++; + } + CG(active_op_array)->start_op_number = CG(active_op_array)->last_executed_op_number; CG(active_op_array)->end_op_number = CG(active_op_array)->last; EG(active_op_array) = CG(active_op_array); |
