summaryrefslogtreecommitdiff
path: root/Zend/zend_execute_API.c
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@php.net>2010-04-20 11:05:54 +0000
committerDmitry Stogov <dmitry@php.net>2010-04-20 11:05:54 +0000
commitdd5c478be61a0ef94b54837cfa875c964356e14f (patch)
treeafdce3c072b3c27f7721c6f24895a147a9f825b4 /Zend/zend_execute_API.c
parent94dd83722b57c4613ccf8371a3c4f50ffc274584 (diff)
downloadphp-git-dd5c478be61a0ef94b54837cfa875c964356e14f.tar.gz
Added concept of interned strings. All strings constants known at compile time are allocated in a single copy and never changed.
Diffstat (limited to 'Zend/zend_execute_API.c')
-rw-r--r--Zend/zend_execute_API.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c
index d0ce7f1bf4..fd4fb928e4 100644
--- a/Zend/zend_execute_API.c
+++ b/Zend/zend_execute_API.c
@@ -525,7 +525,7 @@ ZEND_API int zval_update_constant_ex(zval **pp, void *arg, zend_class_entry *sco
Z_STRLEN_P(p) -= ((colon - Z_STRVAL_P(p)) + 1);
if (inline_change) {
colon = estrndup(colon, Z_STRLEN_P(p));
- efree(Z_STRVAL_P(p));
+ str_efree(Z_STRVAL_P(p));
Z_STRVAL_P(p) = colon;
} else {
Z_STRVAL_P(p) = colon + 1;
@@ -561,12 +561,12 @@ ZEND_API int zval_update_constant_ex(zval **pp, void *arg, zend_class_entry *sco
if (fix_save) {
save--;
}
- if (inline_change) {
+ if (inline_change && !IS_INTERNED(save)) {
efree(save);
}
save = NULL;
}
- if (inline_change && save && save != actual) {
+ if (inline_change && save && save != actual && !IS_INTERNED(save)) {
efree(save);
}
zend_error(E_NOTICE, "Use of undefined constant %s - assumed '%s'", actual, actual);