com php-src: Added comment with problem description and two soltions: Zend/zend_execute_API.c
| From: | Dmitry Stogov | Date: | Tue, 06 May 2014 00:35:29 +0000 |
| Subject: | com php-src: Added comment with problem description and two soltions: Zend/zend_execute_API.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-78111@lists.php.net to get a copy of this message | ||
Commit: 1fa4dcac87c9d5eb887534085b985250a9c1c807
Author: Dmitry Stogov <dmitry@zend.com> Tue, 6 May 2014 04:35:29 +0400
Parents: 8915ad69fbb0f60898f962a67efa8f1b9ebced5a
Branches: phpng
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=1fa4dcac87c9d5eb887534085b985250a9c1c807
Log:
Added comment with problem description and two soltions
Changed paths:
M Zend/zend_execute_API.c
Diff:
diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c
index ff52993..3806af0 100644
--- a/Zend/zend_execute_API.c
+++ b/Zend/zend_execute_API.c
@@ -885,7 +885,22 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache
TS
zval *param;
if (ARG_SHOULD_BE_SENT_BY_REF(EX(function_state).function, i + 1)) {
+ // TODO: Scalar values don't have reference counters anymore.
+ // They are assumed to be 1, and they may be easily passed by
+ // reference now. However, previously scalars with refcount==1
+ // might be passed and with refcount>1 might not. We can support
+ // only single behavior ???
+#if 0
+ if (Z_REFCOUNTED(fci->params[i]) &&
+ // This solution breaks the following test (omit warning message) ???
+ // Zend/tests/bug61273.phpt
+ // ext/reflection/tests/bug42976.phpt
+ // ext/standard/tests/general_functions/call_user_func_array_variation_001.phpt
+#else
if (!Z_REFCOUNTED(fci->params[i]) ||
+ // This solution breaks the following test (emit warning message) ???
+ // ext/pdo_sqlite/tests/pdo_005.phpt
+#endif
(!Z_ISREF(fci->params[i]) && Z_REFCOUNT(fci->params[i]) > 1)) {
if (fci->no_separation &&