summaryrefslogtreecommitdiff
path: root/ext/opcache
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2014-01-09 13:48:08 +0400
committerDmitry Stogov <dmitry@zend.com>2014-01-09 13:48:08 +0400
commitb5fbde9c5bbfc7acc01f0db40b8b5c8d8d8f6c20 (patch)
treedcb4994f4d0bfff0081f4a49c3cbb24bf503f193 /ext/opcache
parent748e707bf94cf3353616727ade7c3a79ef5de25f (diff)
downloadphp-git-b5fbde9c5bbfc7acc01f0db40b8b5c8d8d8f6c20.tar.gz
Fixed ADD_INTERNED_STRING() logic to support strings that are already interned. (Terry)
Diffstat (limited to 'ext/opcache')
-rw-r--r--ext/opcache/zend_persist_calc.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/ext/opcache/zend_persist_calc.c b/ext/opcache/zend_persist_calc.c
index 9f26a24367..e22b7d3952 100644
--- a/ext/opcache/zend_persist_calc.c
+++ b/ext/opcache/zend_persist_calc.c
@@ -33,11 +33,13 @@
#if ZEND_EXTENSION_API_NO > PHP_5_3_X_API_NO
# define ADD_INTERNED_STRING(str, len) do { \
- const char *tmp = accel_new_interned_string((str), (len), !IS_INTERNED((str)) TSRMLS_CC); \
- if (tmp != (str)) { \
- (str) = (char*)tmp; \
- } else { \
- ADD_DUP_SIZE((str), (len)); \
+ if (!IS_INTERNED(str)) { \
+ const char *tmp = accel_new_interned_string((str), (len), 1 TSRMLS_CC); \
+ if (tmp != (str)) { \
+ (str) = (char*)tmp; \
+ } else { \
+ ADD_DUP_SIZE((str), (len)); \
+ } \
} \
} while (0)
#else