From 56f8195fe592e79d90c78fb015f39bffa7f39422 Mon Sep 17 00:00:00 2001 From: Andi Gutmans Date: Mon, 19 Jul 2004 07:19:50 +0000 Subject: - Nuke empty_string. It is a reminanent from the time where RETURN_FALSE() used to return "" and not bool(false). It's not worth keeping it because STR_FREE() and zval_dtor() always have to check for it and it slows down the general case. In addition, it seems that empty_string has been abused quite a lot, and was used not only for setting zval's but generally in PHP code instead of "", which wasn't the intention. Last but not least, nuking empty_string should improve stability as I doubt every place correctly checked if they are not mistakenly erealloc()'ing it or calling efree() on it. NOTE: Some code is probably broken. Each extension maintainer should check and see that my changes are OK. Also, I haven't had time to touch PECL yet. Will try and do it tomorrow. --- Zend/zend_execute.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Zend/zend_execute.c') diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index a958a1be60..4acdcf2c9b 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -111,7 +111,7 @@ static inline zval *_get_zval_ptr(znode *node, temp_variable *Ts, zval **should_ || ((int)T->str_offset.offset<0) || (T->str_offset.str->value.str.len <= T->str_offset.offset)) { zend_error(E_NOTICE, "Uninitialized string offset: %d", T->str_offset.offset); - T->tmp_var.value.str.val = empty_string; + T->tmp_var.value.str.val = STR_EMPTY_ALLOC(); T->tmp_var.value.str.len = 0; } else { char c = str->value.str.val[T->str_offset.offset]; -- cgit v1.2.1