Commit:    d18b9698585820ef0b4adb9efd814d2ca26310a8
Author:    Nikita Popov <ni...@php.net>         Mon, 26 Aug 2013 19:57:14 +0200
Parents:   a13c00cd14179971efd60e8acb450a615c2aff22
Branches:  master

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

Log:
Evaluate ZVAL_ZVAL arguments only once

Also remove some isref/refcount assignments, which are no longer
necessary (as ZVAL_COPY_VALUE is used now).

Changed paths:
  M  Zend/zend_API.h


Diff:
diff --git a/Zend/zend_API.h b/Zend/zend_API.h
index ecc8d9a..1a7c66e 100644
--- a/Zend/zend_API.h
+++ b/Zend/zend_API.h
@@ -594,22 +594,20 @@ END_EXTERN_C()
                Z_TYPE_P(__z) = IS_STRING;      \
        } while (0)
 
-#define ZVAL_ZVAL(z, zv, copy, dtor) {                 \
-               zend_uchar is_ref = Z_ISREF_P(z);               \
-               zend_uint refcount = Z_REFCOUNT_P(z);   \
-               ZVAL_COPY_VALUE(z, zv);                                 \
+#define ZVAL_ZVAL(z, zv, copy, dtor) do {              \
+               zval *__z = (z);                                                
\
+               zval *__zv = (zv);                                              
\
+               ZVAL_COPY_VALUE(__z, __zv);                             \
                if (copy) {                                                     
        \
-                       zval_copy_ctor(z);                                      
\
+                       zval_copy_ctor(__z);                            \
            }                                                                   
        \
                if (dtor) {                                                     
        \
                        if (!copy) {                                            
\
-                               ZVAL_NULL(zv);                                  
\
+                               ZVAL_NULL(__zv);                                
\
                        }                                                       
                \
-                       zval_ptr_dtor(&zv);                                     
\
+                       zval_ptr_dtor(&__zv);                           \
            }                                                                   
        \
-               Z_SET_ISREF_TO_P(z, is_ref);                    \
-               Z_SET_REFCOUNT_P(z, refcount);                  \
-       }
+       } while (0)
 
 #define ZVAL_FALSE(z)                                          ZVAL_BOOL(z, 0)
 #define ZVAL_TRUE(z)                                   ZVAL_BOOL(z, 1)


--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to