Skip to content

Commit 43ab915

Browse files
committed
Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3: Fixed incorrect check. SEND_REF may be executed before DO_FCALL when EX(function_state).function is not yet set to the calling function. Conflicts: Zend/zend_vm_def.h Zend/zend_vm_execute.h
2 parents b3aa3c2 + 4cf0647 commit 43ab915

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

Zend/zend_vm_def.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3140,7 +3140,9 @@ ZEND_VM_HANDLER(67, ZEND_SEND_REF, VAR|CV, ANY)
31403140
ZEND_VM_NEXT_OPCODE();
31413141
}
31423142

3143-
if (EX(function_state).function->type == ZEND_INTERNAL_FUNCTION && !ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.opline_num)) {
3143+
if (opline->extended_value == ZEND_DO_FCALL_BY_NAME &&
3144+
EX(function_state).function->type == ZEND_INTERNAL_FUNCTION &&
3145+
!ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.opline_num)) {
31443146
ZEND_VM_DISPATCH_TO_HELPER(zend_send_by_var_helper);
31453147
}
31463148

Zend/zend_vm_execute.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11171,7 +11171,9 @@ static int ZEND_FASTCALL ZEND_SEND_REF_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
1117111171
ZEND_VM_NEXT_OPCODE();
1117211172
}
1117311173

11174-
if (EX(function_state).function->type == ZEND_INTERNAL_FUNCTION && !ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.opline_num)) {
11174+
if (opline->extended_value == ZEND_DO_FCALL_BY_NAME &&
11175+
EX(function_state).function->type == ZEND_INTERNAL_FUNCTION &&
11176+
!ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.opline_num)) {
1117511177
return zend_send_by_var_helper_SPEC_VAR(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
1117611178
}
1117711179

@@ -27123,7 +27125,9 @@ static int ZEND_FASTCALL ZEND_SEND_REF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS
2712327125
ZEND_VM_NEXT_OPCODE();
2712427126
}
2712527127

27126-
if (EX(function_state).function->type == ZEND_INTERNAL_FUNCTION && !ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.opline_num)) {
27128+
if (opline->extended_value == ZEND_DO_FCALL_BY_NAME &&
27129+
EX(function_state).function->type == ZEND_INTERNAL_FUNCTION &&
27130+
!ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.opline_num)) {
2712727131
return zend_send_by_var_helper_SPEC_CV(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
2712827132
}
2712927133

0 commit comments

Comments
 (0)