]> granicus.if.org Git - php/commitdiff
Cleanup condition in SEND_VAR_NO_REF
authorNikita Popov <nikic@php.net>
Sat, 16 Apr 2016 12:32:48 +0000 (14:32 +0200)
committerNikita Popov <nikic@php.net>
Sat, 16 Apr 2016 12:32:48 +0000 (14:32 +0200)
Was overly convoluted after the IS_VAR_RET_REF removal.

Zend/zend_vm_def.h
Zend/zend_vm_execute.h

index 6c9adea30bc5b2b812a32a3c406f9002e49f0a0f..e8a9ab2890e3acb706282bd62d4b2be588bebbef 100644 (file)
@@ -4272,11 +4272,11 @@ ZEND_VM_HANDLER(106, ZEND_SEND_VAR_NO_REF, VAR, NUM, SEND)
 
        varptr = GET_OP1_ZVAL_PTR(BP_VAR_R);
 
-       if ((!(opline->extended_value & ZEND_ARG_SEND_FUNCTION) ||
-            Z_ISREF_P(varptr)) &&
-           (Z_ISREF_P(varptr) || Z_TYPE_P(varptr) == IS_OBJECT)) {
-
-               ZVAL_MAKE_REF(varptr);
+       if (Z_ISREF_P(varptr)) {
+               /* nothing to do */
+       } else if (!(opline->extended_value & ZEND_ARG_SEND_FUNCTION)
+                       && Z_TYPE_P(varptr) == IS_OBJECT) {
+               ZVAL_NEW_REF(varptr, varptr);
        } else {
                if ((opline->extended_value & ZEND_ARG_COMPILE_TIME_BOUND) ?
                        !(opline->extended_value & ZEND_ARG_SEND_SILENT) :
index 0fc68995357f582b85d6107daf1611bb40feb10c..04e3cf0f75838786e9313193fd9eb548a0bbded5 100644 (file)
@@ -15500,11 +15500,11 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SEND_VAR_NO_REF_SPEC_VAR_HANDL
 
        varptr = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1);
 
-       if ((!(opline->extended_value & ZEND_ARG_SEND_FUNCTION) ||
-            Z_ISREF_P(varptr)) &&
-           (Z_ISREF_P(varptr) || Z_TYPE_P(varptr) == IS_OBJECT)) {
-
-               ZVAL_MAKE_REF(varptr);
+       if (Z_ISREF_P(varptr)) {
+               /* nothing to do */
+       } else if (!(opline->extended_value & ZEND_ARG_SEND_FUNCTION)
+                       && Z_TYPE_P(varptr) == IS_OBJECT) {
+               ZVAL_NEW_REF(varptr, varptr);
        } else {
                if ((opline->extended_value & ZEND_ARG_COMPILE_TIME_BOUND) ?
                        !(opline->extended_value & ZEND_ARG_SEND_SILENT) :