summaryrefslogtreecommitdiff
path: root/Zend/zend_opcode.c
diff options
context:
space:
mode:
authorAaron Piotrowski <aaron@trowski.com>2015-06-14 18:53:11 -0500
committerAaron Piotrowski <aaron@trowski.com>2015-06-14 18:53:11 -0500
commit110e0a5a2cda3bfa7778bb871502ff2b50e59f76 (patch)
treefa736924b4befce442cc72429b4e07812856c541 /Zend/zend_opcode.c
parent5c54bf015dc4fd930394709d80665d9a731f6f99 (diff)
parent6cb7b48846d129f088b50c4a8c4b00b7dc886f5c (diff)
downloadphp-git-110e0a5a2cda3bfa7778bb871502ff2b50e59f76.tar.gz
Merge branch 'master' into throwable-interface
# Conflicts: # Zend/zend_language_scanner.c # Zend/zend_language_scanner.l # ext/simplexml/tests/SimpleXMLElement_xpath.phpt
Diffstat (limited to 'Zend/zend_opcode.c')
-rw-r--r--Zend/zend_opcode.c47
1 files changed, 31 insertions, 16 deletions
diff --git a/Zend/zend_opcode.c b/Zend/zend_opcode.c
index f24fc9f193..abb91b1ee3 100644
--- a/Zend/zend_opcode.c
+++ b/Zend/zend_opcode.c
@@ -180,6 +180,7 @@ ZEND_API void zend_cleanup_internal_class_data(zend_class_entry *ce)
#else
ce->static_members_table = NULL;
#endif
+ ce->ce_flags &= ~ZEND_ACC_CONSTANTS_UPDATED;
while (p != end) {
i_zval_ptr_dtor(p ZEND_FILE_LINE_CC);
p++;
@@ -409,6 +410,10 @@ ZEND_API void destroy_op_array(zend_op_array *op_array)
}
if (arg_info[i].class_name) {
zend_string_release(arg_info[i].class_name);
+
+ if (arg_info[i].lower_class_name) {
+ zend_string_release(arg_info[i].lower_class_name);
+ }
}
}
efree(arg_info);
@@ -666,6 +671,20 @@ static void zend_resolve_finally_ret(zend_op_array *op_array, uint32_t op_num)
}
}
+static uint32_t zend_get_brk_cont_target(const zend_op_array *op_array, const zend_op *opline) {
+ int nest_levels = opline->op2.num;
+ int array_offset = opline->op1.num;
+ zend_brk_cont_element *jmp_to;
+ do {
+ jmp_to = &op_array->brk_cont_array[array_offset];
+ if (nest_levels > 1) {
+ array_offset = jmp_to->parent;
+ }
+ } while (--nest_levels > 0);
+
+ return opline->opcode == ZEND_BRK ? jmp_to->brk : jmp_to->cont;
+}
+
static void zend_resolve_finally_calls(zend_op_array *op_array)
{
uint32_t i, j;
@@ -681,22 +700,8 @@ static void zend_resolve_finally_calls(zend_op_array *op_array)
break;
case ZEND_BRK:
case ZEND_CONT:
- {
- int nest_levels, array_offset;
- zend_brk_cont_element *jmp_to;
-
- nest_levels = Z_LVAL(op_array->literals[opline->op2.constant]);
- if ((array_offset = opline->op1.opline_num) != -1) {
- do {
- jmp_to = &op_array->brk_cont_array[array_offset];
- if (nest_levels > 1) {
- array_offset = jmp_to->parent;
- }
- } while (--nest_levels > 0);
- zend_resolve_finally_call(op_array, i, opline->opcode == ZEND_BRK ? jmp_to->brk : jmp_to->cont);
- break;
- }
- }
+ zend_resolve_finally_call(op_array, i, zend_get_brk_cont_target(op_array, opline));
+ break;
case ZEND_GOTO:
if (Z_TYPE_P(CT_CONSTANT_EX(op_array, opline->op2.constant)) != IS_LONG) {
uint32_t num = opline->op2.constant;
@@ -774,6 +779,16 @@ ZEND_API int pass_two(zend_op_array *op_array)
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:
+ {
+ uint32_t jmp_target = zend_get_brk_cont_target(op_array, opline);
+ opline->opcode = ZEND_JMP;
+ opline->op1.opline_num = jmp_target;
+ opline->op2.num = 0;
+ ZEND_PASS_TWO_UPDATE_JMP_TARGET(op_array, opline, opline->op1);
+ }
+ break;
case ZEND_GOTO:
if (Z_TYPE_P(RT_CONSTANT(op_array, opline->op2)) != IS_LONG) {
zend_resolve_goto_label(op_array, opline, 1);