diff options
author | Dmitry Stogov <dmitry@zend.com> | 2014-01-09 13:48:08 +0400 |
---|---|---|
committer | Dmitry Stogov <dmitry@zend.com> | 2014-01-09 13:48:08 +0400 |
commit | b5fbde9c5bbfc7acc01f0db40b8b5c8d8d8f6c20 (patch) | |
tree | dcb4994f4d0bfff0081f4a49c3cbb24bf503f193 /ext/opcache | |
parent | 748e707bf94cf3353616727ade7c3a79ef5de25f (diff) | |
download | php-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.c | 12 |
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 |