com php-src: Fixed incorrect check. SEND_REF may be exe cuted before DO_FCALL when EX(function_state) .function is not yet set to the calling funct
ion.: Zend/zend_vm_def.h Zend/zend_vm_execute .h

From: Date: Tue, 23 Apr 2013 19:43:23 +0000
Subject: com php-src: Fixed incorrect check. SEND_REF may be exe cuted before DO_FCALL when EX(function_state) .function is not yet set to the calling funct
ion.: Zend/zend_vm_def.h Zend/zend_vm_execute .h
Groups: php.cvs 
Request: Send a blank email to [email protected] to get a copy of this message
Commit:    4cf0647399b7f79fa1d74bba9d528bc74b78ba10
Author:    Dmitry Stogov <[email protected]>         Tue, 23 Apr 2013 23:43:23 +0400
Parents:   f082d6311b7998987f018fc6c791dd1892f2912a
Branches:  PHP-5.3 PHP-5.4 PHP-5..5 master

Link:       http://git.php.net/?p=php-src.git;a=commitdiff;h=4cf0647399b7f79fa1d74bba9d528bc74b78ba10

Log:
Fixed incorrect check. SEND_REF may be executed before DO_FCALL when EX(function_state).function is
not yet set to the calling function.

Changed paths:
  M  Zend/zend_vm_def.h
  M  Zend/zend_vm_execute.h


Diff:
diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h
index eed9245..02566f3 100644
--- a/Zend/zend_vm_def.h
+++ b/Zend/zend_vm_def.h
@@ -2710,7 +2710,9 @@ ZEND_VM_HANDLER(67, ZEND_SEND_REF, VAR|CV, ANY)
 		ZEND_VM_NEXT_OPCODE();
 	}
 
-	if (EX(function_state).function->type == ZEND_INTERNAL_FUNCTION &&
!ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) {
+	if (opline->extended_value == ZEND_DO_FCALL_BY_NAME &&
+	    EX(function_state).function->type == ZEND_INTERNAL_FUNCTION &&
+	    !ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) {
 		ZEND_VM_DISPATCH_TO_HELPER(zend_send_by_var_helper);
 	}
 
diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h
index 6edc91a..f6220b0 100644
--- a/Zend/zend_vm_execute.h
+++ b/Zend/zend_vm_execute.h
@@ -8399,7 +8399,9 @@ static int ZEND_FASTCALL 
ZEND_SEND_REF_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
 		ZEND_VM_NEXT_OPCODE();
 	}
 
-	if (EX(function_state).function->type == ZEND_INTERNAL_FUNCTION &&
!ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) {
+	if (opline->extended_value == ZEND_DO_FCALL_BY_NAME &&
+	    EX(function_state).function->type == ZEND_INTERNAL_FUNCTION &&
+	    !ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) {
 		return zend_send_by_var_helper_SPEC_VAR(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
 	}
 
@@ -22312,7 +22314,9 @@ static int ZEND_FASTCALL 
ZEND_SEND_REF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS
 		ZEND_VM_NEXT_OPCODE();
 	}
 
-	if (EX(function_state).function->type == ZEND_INTERNAL_FUNCTION &&
!ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.u..opline_num)) {
+	if (opline->extended_value == ZEND_DO_FCALL_BY_NAME &&
+	    EX(function_state).function->type == ZEND_INTERNAL_FUNCTION &&
+	    !ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) {
 		return zend_send_by_var_helper_SPEC_CV(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
 	}



Thread (1 message)

  • Dmitry Stogov
« previous php.cvs (#71987) next »