diff options
author | Andi Gutmans <andi@php.net> | 2001-05-11 14:29:06 +0000 |
---|---|---|
committer | Andi Gutmans <andi@php.net> | 2001-05-11 14:29:06 +0000 |
commit | d8c11e6f2a90fd4d633d41782b4d6b07d02ddd45 (patch) | |
tree | 098d5341f18f8e5c804def608d2a8a69635e5169 /Zend | |
parent | 04bd8d9174c40a92df8fb1e6f1069882a083db64 (diff) | |
download | php-git-d8c11e6f2a90fd4d633d41782b4d6b07d02ddd45.tar.gz |
- Fix crash bug when opcodes array is erealloc()'ed to a different memory
area before it reaches the loop.
- Some whitespace stuff
Diffstat (limited to 'Zend')
-rw-r--r-- | Zend/zend_opcode.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/Zend/zend_opcode.c b/Zend/zend_opcode.c index 9578e1dff5..e1fb6b3c37 100644 --- a/Zend/zend_opcode.c +++ b/Zend/zend_opcode.c @@ -274,7 +274,7 @@ static void zend_extension_op_array_handler(zend_extension *extension, zend_op_a int pass_two(zend_op_array *op_array) { - zend_op *opline=op_array->opcodes, *end=opline+op_array->last; + zend_op *opline, *end; CLS_FETCH(); if (op_array->type!=ZEND_USER_FUNCTION && op_array->type!=ZEND_EVAL_CODE) { @@ -286,12 +286,15 @@ 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); } - while (opline<end) { - if (opline->op1.op_type==IS_CONST) { + + opline = op_array->opcodes; + end = opline + 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) { + if (opline->op2.op_type == IS_CONST) { opline->op2.u.constant.is_ref = 1; opline->op2.u.constant.refcount = 2; } |