diff options
| author | Nikita Popov <nikic@php.net> | 2013-09-13 18:45:02 +0200 |
|---|---|---|
| committer | Nikita Popov <nikic@php.net> | 2013-09-13 19:42:10 +0200 |
| commit | 96b1c2145c2cd5e616dea191648c2d73af0239c9 (patch) | |
| tree | c9c8ae54ec95874143310c11f05337d7b7de06ad /Zend/zend_execute_API.c | |
| parent | d2950ac2791cd03559a58e78f5cd626283b9ee4d (diff) | |
| download | php-git-96b1c2145c2cd5e616dea191648c2d73af0239c9.tar.gz | |
Provide more macros for handling of interned strings
* str_erealloc behaves like erealloc for normal strings, but will
use emalloc+memcpy for interned strings.
* str_estrndup behaves like estrndup for normal strings, but will
not copy interned strings.
* str_strndup behaves like zend_strndup for normal strings, but
will not copy interned strings.
* str_efree_rel behaves like efree_rel for normal strings, but
will not free interned strings.
* str_hash will return INTERNED_HASH for interned strings and
compute it using zend_hash_func for normal strings.
Diffstat (limited to 'Zend/zend_execute_API.c')
| -rw-r--r-- | Zend/zend_execute_API.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index 0b29086a0d..d65308f44d 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -533,13 +533,13 @@ ZEND_API int zval_update_constant_ex(zval **pp, void *arg, zend_class_entry *sco if (fix_save) { save--; } - if (inline_change && !IS_INTERNED(save)) { - efree(save); + if (inline_change) { + str_efree(save); } save = NULL; } - if (inline_change && save && save != actual && !IS_INTERNED(save)) { - efree(save); + if (inline_change && save && save != actual) { + str_efree(save); } zend_error(E_NOTICE, "Use of undefined constant %s - assumed '%s'", actual, actual); p->type = IS_STRING; @@ -551,7 +551,7 @@ ZEND_API int zval_update_constant_ex(zval **pp, void *arg, zend_class_entry *sco } } else { if (inline_change) { - STR_FREE(Z_STRVAL_P(p)); + str_efree(Z_STRVAL_P(p)); } *p = const_value; } |
