diff options
author | kusano <kusano@users.noreply.github.com> | 2016-02-17 01:00:58 +0900 |
---|---|---|
committer | kusano <kusano@users.noreply.github.com> | 2016-02-17 01:00:58 +0900 |
commit | 07cae46b02795f8364d28ecad6ec45f507e7114b (patch) | |
tree | 47795fa54a8cf014e918d8bfe3056e9b30ec9b0e /Zend/zend_opcode.c | |
parent | d31e8a9a85efea54db0b647424f6c4485d71db8b (diff) | |
parent | 3244d3c7e936b23ad33892e367500f64468c6140 (diff) | |
download | php-git-07cae46b02795f8364d28ecad6ec45f507e7114b.tar.gz |
Merge branch 'master' into fix-mt_rand
Conflicts:
ext/standard/rand.c
Diffstat (limited to 'Zend/zend_opcode.c')
-rw-r--r-- | Zend/zend_opcode.c | 43 |
1 files changed, 20 insertions, 23 deletions
diff --git a/Zend/zend_opcode.c b/Zend/zend_opcode.c index 0ce6b85938..ab67a88272 100644 --- a/Zend/zend_opcode.c +++ b/Zend/zend_opcode.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2015 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2016 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | @@ -291,9 +291,11 @@ ZEND_API void destroy_zend_class(zval *zv) zend_class_constant *c; ZEND_HASH_FOREACH_PTR(&ce->constants_table, c) { - zval_ptr_dtor(&c->value); - if (c->doc_comment && c->ce == ce) { - zend_string_release(c->doc_comment); + if (c->ce == ce) { + zval_ptr_dtor(&c->value); + if (c->doc_comment) { + zend_string_release(c->doc_comment); + } } } ZEND_HASH_FOREACH_END(); zend_hash_destroy(&ce->constants_table); @@ -419,9 +421,8 @@ ZEND_API void destroy_op_array(zend_op_array *op_array) } } if (op_array->arg_info) { - int32_t num_args = op_array->num_args; + uint32_t num_args = op_array->num_args; zend_arg_info *arg_info = op_array->arg_info; - int32_t i; if (op_array->fn_flags & ZEND_ACC_HAS_RETURN_TYPE) { arg_info--; @@ -610,7 +611,7 @@ ZEND_API int pass_two(zend_op_array *op_array) zend_update_extended_info(op_array); } if (CG(compiler_options) & ZEND_COMPILE_HANDLE_OP_ARRAY) { - if (zend_extension_flags & ZEND_EXTENSIONS_HAVE_OP_ARRAY_PERSIST) { + if (zend_extension_flags & ZEND_EXTENSIONS_HAVE_OP_ARRAY_HANDLER) { zend_llist_apply_with_argument(&zend_extensions, (llist_apply_with_arg_func_t) zend_extension_op_array_handler, op_array); } } @@ -639,13 +640,6 @@ ZEND_API int pass_two(zend_op_array *op_array) case ZEND_FAST_RET: zend_resolve_finally_ret(op_array, opline - op_array->opcodes); break; - case ZEND_DECLARE_ANON_INHERITED_CLASS: - ZEND_PASS_TWO_UPDATE_JMP_TARGET(op_array, opline, opline->op1); - /* break omitted intentionally */ - case ZEND_DECLARE_INHERITED_CLASS: - case ZEND_DECLARE_INHERITED_CLASS_DELAYED: - opline->extended_value = (uint32_t)(zend_intptr_t)ZEND_CALL_VAR_NUM(NULL, op_array->last_var + opline->extended_value); - break; case ZEND_BRK: case ZEND_CONT: { @@ -667,13 +661,8 @@ ZEND_API int pass_two(zend_op_array *op_array) } /* break omitted intentionally */ case ZEND_JMP: - case ZEND_DECLARE_ANON_CLASS: ZEND_PASS_TWO_UPDATE_JMP_TARGET(op_array, opline, opline->op1); break; - case ZEND_CATCH: - /* absolute index to relative offset */ - opline->extended_value = ZEND_OPLINE_NUM_TO_OFFSET(op_array, opline, opline->extended_value); - break; case ZEND_JMPZNZ: /* absolute index to relative offset */ opline->extended_value = ZEND_OPLINE_NUM_TO_OFFSET(op_array, opline, opline->extended_value); @@ -691,21 +680,29 @@ ZEND_API int pass_two(zend_op_array *op_array) break; case ZEND_ASSERT_CHECK: /* If result of assert is unused, result of check is unused as well */ - if (op_array->opcodes[opline->op2.opline_num - 1].result_type & EXT_TYPE_UNUSED) { - opline->result_type |= EXT_TYPE_UNUSED; + if (op_array->opcodes[opline->op2.opline_num - 1].result_type == IS_UNUSED) { + opline->result_type = IS_UNUSED; } ZEND_PASS_TWO_UPDATE_JMP_TARGET(op_array, opline, opline->op2); break; + case ZEND_DECLARE_ANON_CLASS: + case ZEND_DECLARE_ANON_INHERITED_CLASS: + case ZEND_CATCH: case ZEND_FE_FETCH_R: case ZEND_FE_FETCH_RW: + /* absolute index to relative offset */ opline->extended_value = ZEND_OPLINE_NUM_TO_OFFSET(op_array, opline, opline->extended_value); break; case ZEND_VERIFY_RETURN_TYPE: if (op_array->fn_flags & ZEND_ACC_GENERATOR) { if (opline->op1_type != IS_UNUSED) { - (opline + 1)->op1 = opline->op1; - (opline + 1)->op1_type = opline->op1_type; + zend_op *ret = opline; + do ret++; while (ret->opcode != ZEND_RETURN); + + ret->op1 = opline->op1; + ret->op1_type = opline->op1_type; } + MAKE_NOP(opline); } break; |