Skip to content

Commit 7289981

Browse files
committed
Merge branch 'PHP-5.5' into PHP-5.6
2 parents e49a0e1 + 7af9ba2 commit 7289981

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

Zend/zend_vm_def.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5425,7 +5425,6 @@ ZEND_VM_HANDLER(153, ZEND_DECLARE_LAMBDA_FUNCTION, CONST, UNUSED)
54255425
{
54265426
USE_OPLINE
54275427
zend_function *op_array;
5428-
int closure_is_static, closure_is_being_defined_inside_static_context;
54295428

54305429
SAVE_OPLINE();
54315430

@@ -5434,9 +5433,9 @@ ZEND_VM_HANDLER(153, ZEND_DECLARE_LAMBDA_FUNCTION, CONST, UNUSED)
54345433
zend_error_noreturn(E_ERROR, "Base lambda function for closure not found");
54355434
}
54365435

5437-
closure_is_static = op_array->common.fn_flags & ZEND_ACC_STATIC;
5438-
closure_is_being_defined_inside_static_context = EX(prev_execute_data) && EX(prev_execute_data)->function_state.function->common.fn_flags & ZEND_ACC_STATIC;
5439-
if (closure_is_static || closure_is_being_defined_inside_static_context) {
5436+
if (UNEXPECTED((op_array->common.fn_flags & ZEND_ACC_STATIC) ||
5437+
(EX(prev_execute_data) &&
5438+
EX(prev_execute_data)->function_state.function->common.fn_flags & ZEND_ACC_STATIC))) {
54405439
zend_create_closure(&EX_T(opline->result.var).tmp_var, (zend_function *) op_array, EG(called_scope), NULL TSRMLS_CC);
54415440
} else {
54425441
zend_create_closure(&EX_T(opline->result.var).tmp_var, (zend_function *) op_array, EG(scope), EG(This) TSRMLS_CC);

Zend/zend_vm_execute.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6801,7 +6801,6 @@ static int ZEND_FASTCALL ZEND_DECLARE_LAMBDA_FUNCTION_SPEC_CONST_UNUSED_HANDLER
68016801
{
68026802
USE_OPLINE
68036803
zend_function *op_array;
6804-
int closure_is_static, closure_is_being_defined_inside_static_context;
68056804

68066805
SAVE_OPLINE();
68076806

@@ -6810,9 +6809,9 @@ static int ZEND_FASTCALL ZEND_DECLARE_LAMBDA_FUNCTION_SPEC_CONST_UNUSED_HANDLER
68106809
zend_error_noreturn(E_ERROR, "Base lambda function for closure not found");
68116810
}
68126811

6813-
closure_is_static = op_array->common.fn_flags & ZEND_ACC_STATIC;
6814-
closure_is_being_defined_inside_static_context = EX(prev_execute_data) && EX(prev_execute_data)->function_state.function->common.fn_flags & ZEND_ACC_STATIC;
6815-
if (closure_is_static || closure_is_being_defined_inside_static_context) {
6812+
if (UNEXPECTED((op_array->common.fn_flags & ZEND_ACC_STATIC) ||
6813+
(EX(prev_execute_data) &&
6814+
EX(prev_execute_data)->function_state.function->common.fn_flags & ZEND_ACC_STATIC))) {
68166815
zend_create_closure(&EX_T(opline->result.var).tmp_var, (zend_function *) op_array, EG(called_scope), NULL TSRMLS_CC);
68176816
} else {
68186817
zend_create_closure(&EX_T(opline->result.var).tmp_var, (zend_function *) op_array, EG(scope), EG(This) TSRMLS_CC);

0 commit comments

Comments
 (0)