summaryrefslogtreecommitdiff
path: root/Zend/zend_types.h
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2018-06-22 12:58:48 +0200
committerNikita Popov <nikita.ppv@gmail.com>2018-06-25 15:04:09 +0200
commit2543e61aed67add7522e0b4cdf9a13cf3e441f6f (patch)
tree35349a532edd97e52927275f2fe474979df614ec /Zend/zend_types.h
parent102bcb5c05d91b5138c72df5b118b25c6f9ad383 (diff)
downloadphp-git-2543e61aed67add7522e0b4cdf9a13cf3e441f6f.tar.gz
Fixed bug #76509
In PHP static properties are shared between inheriting classes, unless they are explicitly overwritten. However, because this functionality was implemented using reference, it was possible to break the implementation by reassigning the static property reference. This is fixed by switching the implementation from using references to using INDIRECTs, which cannot be affected by userland code.
Diffstat (limited to 'Zend/zend_types.h')
-rw-r--r--Zend/zend_types.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/Zend/zend_types.h b/Zend/zend_types.h
index 8e6a21d052..59b0af1a4a 100644
--- a/Zend/zend_types.h
+++ b/Zend/zend_types.h
@@ -1101,6 +1101,12 @@ static zend_always_inline uint32_t zval_delref_p(zval* pz) {
} \
} while (0)
+#define ZVAL_DEINDIRECT(z) do { \
+ if (Z_TYPE_P(z) == IS_INDIRECT) { \
+ (z) = Z_INDIRECT_P(z); \
+ } \
+ } while (0)
+
#define ZVAL_OPT_DEREF(z) do { \
if (UNEXPECTED(Z_OPT_ISREF_P(z))) { \
(z) = Z_REFVAL_P(z); \