From c224e239bdea39be5ddef940a9a1e51c0896d49d Mon Sep 17 00:00:00 2001 From: Anthony Ferrara Date: Mon, 1 Jul 2013 16:53:54 -0400 Subject: Re-do a lot of it using a conditional define, and legacy type information for APIs --- Zend/zend_execute_API.c | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) (limited to 'Zend/zend_execute_API.c') diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index 779e6d886f..d320d9cfa3 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -401,7 +401,7 @@ ZEND_API const char *zend_get_executed_filename(TSRMLS_D) /* {{{ */ } /* }}} */ -ZEND_API uint zend_get_executed_lineno(TSRMLS_D) /* {{{ */ +ZEND_API zend_str_size_uint zend_get_executed_lineno(TSRMLS_D) /* {{{ */ { if(EG(exception) && EG(opline_ptr) && active_opline->opcode == ZEND_HANDLE_EXCEPTION && active_opline->lineno == 0 && EG(opline_before_exception)) { @@ -505,7 +505,7 @@ ZEND_API int zval_update_constant_ex(zval **pp, void *arg, zend_class_entry *sco } } else { char *save = actual, *slash; - int actual_len = Z_STRLEN_P(p); + zend_str_size actual_len = Z_STRLEN_P(p); if ((Z_TYPE_P(p) & IS_CONSTANT_UNQUALIFIED) && (slash = (char *)zend_memrchr(actual, '\\', actual_len))) { actual = slash + 1; actual_len -= (actual - Z_STRVAL_P(p)); @@ -562,7 +562,7 @@ ZEND_API int zval_update_constant_ex(zval **pp, void *arg, zend_class_entry *sco } else if (Z_TYPE_P(p) == IS_CONSTANT_ARRAY) { zval **element, *new_val; char *str_index; - uint str_index_len; + zend_str_size str_index_len; ulong num_index; int ret; @@ -1011,13 +1011,14 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS } /* }}} */ -ZEND_API int zend_lookup_class_ex(const char *name, int name_length, const zend_literal *key, int use_autoload, zend_class_entry ***ce TSRMLS_DC) /* {{{ */ +ZEND_API int zend_lookup_class_ex(const char *name, zend_str_size_int name_length, const zend_literal *key, int use_autoload, zend_class_entry ***ce TSRMLS_DC) /* {{{ */ { zval **args[1]; zval autoload_function; zval *class_name_ptr; zval *retval_ptr = NULL; - int retval, lc_length; + int retval; + zend_str_size lc_length; char *lc_name; char *lc_free; zend_fcall_info fcall_info; @@ -1128,13 +1129,13 @@ ZEND_API int zend_lookup_class_ex(const char *name, int name_length, const zend_ } /* }}} */ -ZEND_API int zend_lookup_class(const char *name, int name_length, zend_class_entry ***ce TSRMLS_DC) /* {{{ */ +ZEND_API int zend_lookup_class(const char *name, zend_str_size_int name_length, zend_class_entry ***ce TSRMLS_DC) /* {{{ */ { return zend_lookup_class_ex(name, name_length, NULL, 1, ce TSRMLS_CC); } /* }}} */ -ZEND_API int zend_eval_stringl(char *str, int str_len, zval *retval_ptr, char *string_name TSRMLS_DC) /* {{{ */ +ZEND_API int zend_eval_stringl(char *str, zend_str_size_int str_len, zval *retval_ptr, char *string_name TSRMLS_DC) /* {{{ */ { zval pv; zend_op_array *new_op_array; @@ -1220,7 +1221,7 @@ ZEND_API int zend_eval_string(char *str, zval *retval_ptr, char *string_name TSR } /* }}} */ -ZEND_API int zend_eval_stringl_ex(char *str, int str_len, zval *retval_ptr, char *string_name, int handle_exceptions TSRMLS_DC) /* {{{ */ +ZEND_API int zend_eval_stringl_ex(char *str, zend_str_size_int str_len, zval *retval_ptr, char *string_name, int handle_exceptions TSRMLS_DC) /* {{{ */ { int result; @@ -1525,7 +1526,7 @@ void zend_unset_timeout(TSRMLS_D) /* {{{ */ } /* }}} */ -zend_class_entry *zend_fetch_class(const char *class_name, uint class_name_len, int fetch_type TSRMLS_DC) /* {{{ */ +zend_class_entry *zend_fetch_class(const char *class_name, zend_str_size_uint class_name_len, int fetch_type TSRMLS_DC) /* {{{ */ { zend_class_entry **pce; int use_autoload = (fetch_type & ZEND_FETCH_CLASS_NO_AUTOLOAD) == 0; @@ -1580,7 +1581,7 @@ check_fetch_type: } /* }}} */ -zend_class_entry *zend_fetch_class_by_name(const char *class_name, uint class_name_len, const zend_literal *key, int fetch_type TSRMLS_DC) /* {{{ */ +zend_class_entry *zend_fetch_class_by_name(const char *class_name, zend_str_size_uint class_name_len, const zend_literal *key, int fetch_type TSRMLS_DC) /* {{{ */ { zend_class_entry **pce; int use_autoload = (fetch_type & ZEND_FETCH_CLASS_NO_AUTOLOAD) == 0; @@ -1675,7 +1676,7 @@ ZEND_API void zend_reset_all_cv(HashTable *symbol_table TSRMLS_DC) /* {{{ */ } /* }}} */ -ZEND_API void zend_delete_variable(zend_execute_data *ex, HashTable *ht, const char *name, int name_len, ulong hash_value TSRMLS_DC) /* {{{ */ +ZEND_API void zend_delete_variable(zend_execute_data *ex, HashTable *ht, const char *name, zend_str_size_int name_len, ulong hash_value TSRMLS_DC) /* {{{ */ { if (zend_hash_quick_del(ht, name, name_len, hash_value) == SUCCESS) { name_len--; @@ -1698,7 +1699,7 @@ ZEND_API void zend_delete_variable(zend_execute_data *ex, HashTable *ht, const c } /* }}} */ -ZEND_API int zend_delete_global_variable_ex(const char *name, int name_len, ulong hash_value TSRMLS_DC) /* {{{ */ +ZEND_API int zend_delete_global_variable_ex(const char *name, zend_str_size_int name_len, ulong hash_value TSRMLS_DC) /* {{{ */ { zend_execute_data *ex; @@ -1723,7 +1724,7 @@ ZEND_API int zend_delete_global_variable_ex(const char *name, int name_len, ulon } /* }}} */ -ZEND_API int zend_delete_global_variable(const char *name, int name_len TSRMLS_DC) /* {{{ */ +ZEND_API int zend_delete_global_variable(const char *name, zend_str_size_int name_len TSRMLS_DC) /* {{{ */ { return zend_delete_global_variable_ex(name, name_len, zend_inline_hash_func(name, name_len + 1) TSRMLS_CC); } -- cgit v1.2.1 From e6f90ecc27f5d305a0e755da67db75da786f4568 Mon Sep 17 00:00:00 2001 From: Anthony Ferrara Date: Tue, 2 Jul 2013 09:46:30 -0400 Subject: It compiles. Sort-of. In a way. Yeah. But nothing works. Sigh --- Zend/zend_execute_API.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'Zend/zend_execute_API.c') diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index d320d9cfa3..34bc9726c7 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -493,11 +493,11 @@ ZEND_API int zval_update_constant_ex(zval **pp, void *arg, zend_class_entry *sco if (!zend_get_constant_ex(p->value.str.val, p->value.str.len, &const_value, scope, Z_REAL_TYPE_P(p) TSRMLS_CC)) { char *actual = Z_STRVAL_P(p); - if ((colon = (char*)zend_memrchr(Z_STRVAL_P(p), ':', Z_STRLEN_P(p)))) { + if ((colon = (char*)zend_memrchr(Z_STRVAL_P(p), ':', Z_STRSIZE_P(p)))) { zend_error(E_ERROR, "Undefined class constant '%s'", Z_STRVAL_P(p)); - Z_STRLEN_P(p) -= ((colon - Z_STRVAL_P(p)) + 1); + Z_STRSIZE_P(p) -= ((colon - Z_STRVAL_P(p)) + 1); if (inline_change) { - colon = estrndup(colon, Z_STRLEN_P(p)); + colon = estrndup(colon, Z_STRSIZE_P(p)); str_efree(Z_STRVAL_P(p)); Z_STRVAL_P(p) = colon; } else { @@ -505,20 +505,20 @@ ZEND_API int zval_update_constant_ex(zval **pp, void *arg, zend_class_entry *sco } } else { char *save = actual, *slash; - zend_str_size actual_len = Z_STRLEN_P(p); + zend_str_size actual_len = Z_STRSIZE_P(p); if ((Z_TYPE_P(p) & IS_CONSTANT_UNQUALIFIED) && (slash = (char *)zend_memrchr(actual, '\\', actual_len))) { actual = slash + 1; actual_len -= (actual - Z_STRVAL_P(p)); if (inline_change) { actual = estrndup(actual, actual_len); Z_STRVAL_P(p) = actual; - Z_STRLEN_P(p) = actual_len; + Z_STRSIZE_P(p) = actual_len; } } if (actual[0] == '\\') { if (inline_change) { - memmove(Z_STRVAL_P(p), Z_STRVAL_P(p)+1, Z_STRLEN_P(p)); - --Z_STRLEN_P(p); + memmove(Z_STRVAL_P(p), Z_STRVAL_P(p)+1, Z_STRSIZE_P(p)); + --Z_STRSIZE_P(p); } else { ++actual; } @@ -546,7 +546,7 @@ ZEND_API int zval_update_constant_ex(zval **pp, void *arg, zend_class_entry *sco p->type = IS_STRING; if (!inline_change) { Z_STRVAL_P(p) = actual; - Z_STRLEN_P(p) = actual_len; + Z_STRSIZE_P(p) = actual_len; zval_copy_ctor(p); } } @@ -637,7 +637,7 @@ ZEND_API int zval_update_constant_ex(zval **pp, void *arg, zend_class_entry *sco switch (Z_TYPE(const_value)) { case IS_STRING: - ret = zend_symtable_update_current_key(Z_ARRVAL_P(p), Z_STRVAL(const_value), Z_STRLEN(const_value) + 1, HASH_UPDATE_KEY_IF_BEFORE); + ret = zend_symtable_update_current_key(Z_ARRVAL_P(p), Z_STRVAL(const_value), Z_STRSIZE(const_value) + 1, HASH_UPDATE_KEY_IF_BEFORE); break; case IS_BOOL: case IS_LONG: @@ -1029,7 +1029,7 @@ ZEND_API int zend_lookup_class_ex(const char *name, zend_str_size_int name_lengt if (key) { lc_name = Z_STRVAL(key->constant); - lc_length = Z_STRLEN(key->constant) + 1; + lc_length = Z_STRSIZE(key->constant) + 1; hash = key->hash_value; } else { if (name == NULL || !name_length) { @@ -1144,14 +1144,14 @@ ZEND_API int zend_eval_stringl(char *str, zend_str_size_int str_len, zval *retva int retval; if (retval_ptr) { - Z_STRLEN(pv) = str_len + sizeof("return ;") - 1; - Z_STRVAL(pv) = emalloc(Z_STRLEN(pv) + 1); + Z_STRSIZE(pv) = str_len + sizeof("return ;") - 1; + Z_STRVAL(pv) = emalloc(Z_STRSIZE(pv) + 1); memcpy(Z_STRVAL(pv), "return ", sizeof("return ") - 1); memcpy(Z_STRVAL(pv) + sizeof("return ") - 1, str, str_len); - Z_STRVAL(pv)[Z_STRLEN(pv) - 1] = ';'; - Z_STRVAL(pv)[Z_STRLEN(pv)] = '\0'; + Z_STRVAL(pv)[Z_STRSIZE(pv) - 1] = ';'; + Z_STRVAL(pv)[Z_STRSIZE(pv)] = '\0'; } else { - Z_STRLEN(pv) = str_len; + Z_STRSIZE(pv) = str_len; Z_STRVAL(pv) = str; } Z_TYPE(pv) = IS_STRING; -- cgit v1.2.1 From 98c6e0d53507d9b949caa1a21df668faea43eaad Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Thu, 7 Nov 2013 14:03:36 +0100 Subject: first shot for 64 bit array indexes, more broken things to fix --- Zend/zend_execute_API.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Zend/zend_execute_API.c') diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index 34bc9726c7..a5de29c5c5 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -563,7 +563,7 @@ ZEND_API int zval_update_constant_ex(zval **pp, void *arg, zend_class_entry *sco zval **element, *new_val; char *str_index; zend_str_size str_index_len; - ulong num_index; + zend_uint_t num_index; int ret; SEPARATE_ZVAL_IF_NOT_REF(pp); @@ -1024,7 +1024,7 @@ ZEND_API int zend_lookup_class_ex(const char *name, zend_str_size_int name_lengt zend_fcall_info fcall_info; zend_fcall_info_cache fcall_cache; char dummy = 1; - ulong hash; + zend_uint_t hash; ALLOCA_FLAG(use_heap) if (key) { @@ -1676,7 +1676,7 @@ ZEND_API void zend_reset_all_cv(HashTable *symbol_table TSRMLS_DC) /* {{{ */ } /* }}} */ -ZEND_API void zend_delete_variable(zend_execute_data *ex, HashTable *ht, const char *name, zend_str_size_int name_len, ulong hash_value TSRMLS_DC) /* {{{ */ +ZEND_API void zend_delete_variable(zend_execute_data *ex, HashTable *ht, const char *name, zend_str_size_int name_len, zend_uint_t hash_value TSRMLS_DC) /* {{{ */ { if (zend_hash_quick_del(ht, name, name_len, hash_value) == SUCCESS) { name_len--; @@ -1699,7 +1699,7 @@ ZEND_API void zend_delete_variable(zend_execute_data *ex, HashTable *ht, const c } /* }}} */ -ZEND_API int zend_delete_global_variable_ex(const char *name, zend_str_size_int name_len, ulong hash_value TSRMLS_DC) /* {{{ */ +ZEND_API int zend_delete_global_variable_ex(const char *name, zend_str_size_int name_len, zend_uint_t hash_value TSRMLS_DC) /* {{{ */ { zend_execute_data *ex; -- cgit v1.2.1 From a73c8812a16ffa5bf730412ff51bb36beee89c5a Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Sun, 24 Nov 2013 16:06:47 +0100 Subject: one more walk through in Zend, fixed things being overseen --- Zend/zend_execute_API.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Zend/zend_execute_API.c') diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index a5de29c5c5..0cc05e8025 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -1447,7 +1447,7 @@ void zend_shutdown_timeout_thread(void) /* {{{ */ #define SIGPROF 27 #endif -void zend_set_timeout(long seconds, int reset_signals) /* {{{ */ +void zend_set_timeout(zend_int_t seconds, int reset_signals) /* {{{ */ { TSRMLS_FETCH(); -- cgit v1.2.1 From b1abe4ca21e10b04a8bae2d00e8113f4b2b02567 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Wed, 18 Dec 2013 14:46:44 -0800 Subject: mass replacement for zend_size_t/php_size_t --- Zend/zend_execute_API.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'Zend/zend_execute_API.c') diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index 6b7e192eaa..97a6c35553 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -401,7 +401,7 @@ ZEND_API const char *zend_get_executed_filename(TSRMLS_D) /* {{{ */ } /* }}} */ -ZEND_API zend_str_size_uint zend_get_executed_lineno(TSRMLS_D) /* {{{ */ +ZEND_API zend_size_t zend_get_executed_lineno(TSRMLS_D) /* {{{ */ { if(EG(exception) && EG(opline_ptr) && active_opline->opcode == ZEND_HANDLE_EXCEPTION && active_opline->lineno == 0 && EG(opline_before_exception)) { @@ -505,7 +505,7 @@ ZEND_API int zval_update_constant_ex(zval **pp, void *arg, zend_class_entry *sco } } else { char *save = actual, *slash; - zend_str_size actual_len = Z_STRSIZE_P(p); + zend_size_t actual_len = Z_STRSIZE_P(p); if ((Z_TYPE_P(p) & IS_CONSTANT_UNQUALIFIED) && (slash = (char *)zend_memrchr(actual, '\\', actual_len))) { actual = slash + 1; actual_len -= (actual - Z_STRVAL_P(p)); @@ -562,7 +562,7 @@ ZEND_API int zval_update_constant_ex(zval **pp, void *arg, zend_class_entry *sco } else if (Z_TYPE_P(p) == IS_CONSTANT_ARRAY) { zval **element, *new_val; char *str_index; - zend_str_size str_index_len; + zend_size_t str_index_len; zend_uint_t num_index; int ret; @@ -1023,14 +1023,14 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS } /* }}} */ -ZEND_API int zend_lookup_class_ex(const char *name, zend_str_size_int name_length, const zend_literal *key, int use_autoload, zend_class_entry ***ce TSRMLS_DC) /* {{{ */ +ZEND_API int zend_lookup_class_ex(const char *name, zend_size_t name_length, const zend_literal *key, int use_autoload, zend_class_entry ***ce TSRMLS_DC) /* {{{ */ { zval **args[1]; zval autoload_function; zval *class_name_ptr; zval *retval_ptr = NULL; int retval; - zend_str_size lc_length; + zend_size_t lc_length; char *lc_name; char *lc_free; zend_fcall_info fcall_info; @@ -1149,13 +1149,13 @@ ZEND_API int zend_lookup_class_ex(const char *name, zend_str_size_int name_lengt } /* }}} */ -ZEND_API int zend_lookup_class(const char *name, zend_str_size_int name_length, zend_class_entry ***ce TSRMLS_DC) /* {{{ */ +ZEND_API int zend_lookup_class(const char *name, zend_size_t name_length, zend_class_entry ***ce TSRMLS_DC) /* {{{ */ { return zend_lookup_class_ex(name, name_length, NULL, 1, ce TSRMLS_CC); } /* }}} */ -ZEND_API int zend_eval_stringl(char *str, zend_str_size_int str_len, zval *retval_ptr, char *string_name TSRMLS_DC) /* {{{ */ +ZEND_API int zend_eval_stringl(char *str, zend_size_t str_len, zval *retval_ptr, char *string_name TSRMLS_DC) /* {{{ */ { zval pv; zend_op_array *new_op_array; @@ -1241,7 +1241,7 @@ ZEND_API int zend_eval_string(char *str, zval *retval_ptr, char *string_name TSR } /* }}} */ -ZEND_API int zend_eval_stringl_ex(char *str, zend_str_size_int str_len, zval *retval_ptr, char *string_name, int handle_exceptions TSRMLS_DC) /* {{{ */ +ZEND_API int zend_eval_stringl_ex(char *str, zend_size_t str_len, zval *retval_ptr, char *string_name, int handle_exceptions TSRMLS_DC) /* {{{ */ { int result; @@ -1546,7 +1546,7 @@ void zend_unset_timeout(TSRMLS_D) /* {{{ */ } /* }}} */ -zend_class_entry *zend_fetch_class(const char *class_name, zend_str_size_uint class_name_len, int fetch_type TSRMLS_DC) /* {{{ */ +zend_class_entry *zend_fetch_class(const char *class_name, zend_size_t class_name_len, int fetch_type TSRMLS_DC) /* {{{ */ { zend_class_entry **pce; int use_autoload = (fetch_type & ZEND_FETCH_CLASS_NO_AUTOLOAD) == 0; @@ -1601,7 +1601,7 @@ check_fetch_type: } /* }}} */ -zend_class_entry *zend_fetch_class_by_name(const char *class_name, zend_str_size_uint class_name_len, const zend_literal *key, int fetch_type TSRMLS_DC) /* {{{ */ +zend_class_entry *zend_fetch_class_by_name(const char *class_name, zend_size_t class_name_len, const zend_literal *key, int fetch_type TSRMLS_DC) /* {{{ */ { zend_class_entry **pce; int use_autoload = (fetch_type & ZEND_FETCH_CLASS_NO_AUTOLOAD) == 0; @@ -1696,7 +1696,7 @@ ZEND_API void zend_reset_all_cv(HashTable *symbol_table TSRMLS_DC) /* {{{ */ } /* }}} */ -ZEND_API void zend_delete_variable(zend_execute_data *ex, HashTable *ht, const char *name, zend_str_size_int name_len, zend_uint_t hash_value TSRMLS_DC) /* {{{ */ +ZEND_API void zend_delete_variable(zend_execute_data *ex, HashTable *ht, const char *name, zend_size_t name_len, zend_uint_t hash_value TSRMLS_DC) /* {{{ */ { if (zend_hash_quick_del(ht, name, name_len, hash_value) == SUCCESS) { name_len--; @@ -1719,7 +1719,7 @@ ZEND_API void zend_delete_variable(zend_execute_data *ex, HashTable *ht, const c } /* }}} */ -ZEND_API int zend_delete_global_variable_ex(const char *name, zend_str_size_int name_len, zend_uint_t hash_value TSRMLS_DC) /* {{{ */ +ZEND_API int zend_delete_global_variable_ex(const char *name, zend_size_t name_len, zend_uint_t hash_value TSRMLS_DC) /* {{{ */ { zend_execute_data *ex; @@ -1744,7 +1744,7 @@ ZEND_API int zend_delete_global_variable_ex(const char *name, zend_str_size_int } /* }}} */ -ZEND_API int zend_delete_global_variable(const char *name, zend_str_size_int name_len TSRMLS_DC) /* {{{ */ +ZEND_API int zend_delete_global_variable(const char *name, zend_size_t name_len TSRMLS_DC) /* {{{ */ { return zend_delete_global_variable_ex(name, name_len, zend_inline_hash_func(name, name_len + 1) TSRMLS_CC); } -- cgit v1.2.1 From f58d0b35edf25a8f39fad6bd5e0e4eeb5cdfe9a7 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Thu, 19 Dec 2013 05:07:37 -0800 Subject: massive update semantical LONG vs INT replacements --- Zend/zend_execute_API.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Zend/zend_execute_API.c') diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index 97a6c35553..af6bfa483d 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -643,11 +643,11 @@ ZEND_API int zval_update_constant_ex(zval **pp, void *arg, zend_class_entry *sco ret = zend_symtable_update_current_key(Z_ARRVAL_P(p), Z_STRVAL(const_value), Z_STRSIZE(const_value) + 1, HASH_UPDATE_KEY_IF_BEFORE); break; case IS_BOOL: - case IS_LONG: - ret = zend_hash_update_current_key_ex(Z_ARRVAL_P(p), HASH_KEY_IS_LONG, NULL, 0, Z_LVAL(const_value), HASH_UPDATE_KEY_IF_BEFORE, NULL); + case IS_INT: + ret = zend_hash_update_current_key_ex(Z_ARRVAL_P(p), HASH_KEY_IS_INT, NULL, 0, Z_IVAL(const_value), HASH_UPDATE_KEY_IF_BEFORE, NULL); break; case IS_DOUBLE: - ret = zend_hash_update_current_key_ex(Z_ARRVAL_P(p), HASH_KEY_IS_LONG, NULL, 0, zend_dval_to_lval(Z_DVAL(const_value)), HASH_UPDATE_KEY_IF_BEFORE, NULL); + ret = zend_hash_update_current_key_ex(Z_ARRVAL_P(p), HASH_KEY_IS_INT, NULL, 0, zend_dval_to_lval(Z_DVAL(const_value)), HASH_UPDATE_KEY_IF_BEFORE, NULL); break; case IS_NULL: ret = zend_hash_update_current_key_ex(Z_ARRVAL_P(p), HASH_KEY_IS_STRING, "", 1, 0, HASH_UPDATE_KEY_IF_BEFORE, NULL); @@ -1295,7 +1295,7 @@ void execute_new_code(TSRMLS_D) /* {{{ */ } switch (opline->opcode) { case ZEND_GOTO: - if (Z_TYPE_P(opline->op2.zv) != IS_LONG) { + if (Z_TYPE_P(opline->op2.zv) != IS_INT) { zend_resolve_goto_label(CG(active_op_array), opline, 1 TSRMLS_CC); } /* break omitted intentionally */ -- cgit v1.2.1 From f2fc935502b110b7a706d1641c000a9e9500315b Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Thu, 19 Dec 2013 23:28:52 -0800 Subject: next wave on semantical replacements long vs. int --- Zend/zend_execute_API.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Zend/zend_execute_API.c') diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index af6bfa483d..57a9848792 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -647,7 +647,7 @@ ZEND_API int zval_update_constant_ex(zval **pp, void *arg, zend_class_entry *sco ret = zend_hash_update_current_key_ex(Z_ARRVAL_P(p), HASH_KEY_IS_INT, NULL, 0, Z_IVAL(const_value), HASH_UPDATE_KEY_IF_BEFORE, NULL); break; case IS_DOUBLE: - ret = zend_hash_update_current_key_ex(Z_ARRVAL_P(p), HASH_KEY_IS_INT, NULL, 0, zend_dval_to_lval(Z_DVAL(const_value)), HASH_UPDATE_KEY_IF_BEFORE, NULL); + ret = zend_hash_update_current_key_ex(Z_ARRVAL_P(p), HASH_KEY_IS_INT, NULL, 0, zend_dval_to_ival(Z_DVAL(const_value)), HASH_UPDATE_KEY_IF_BEFORE, NULL); break; case IS_NULL: ret = zend_hash_update_current_key_ex(Z_ARRVAL_P(p), HASH_KEY_IS_STRING, "", 1, 0, HASH_UPDATE_KEY_IF_BEFORE, NULL); -- cgit v1.2.1 From 2fd7f7c8252a8d55d3227527fe1e21acbfd22878 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Sat, 15 Feb 2014 14:04:53 +0100 Subject: backported Zend --- Zend/zend_execute_API.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Zend/zend_execute_API.c') diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index 7629134e99..08b9bb2dc2 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -443,9 +443,9 @@ ZEND_API void _zval_internal_ptr_dtor(zval **zval_ptr ZEND_FILE_LINE_DC) /* {{{ } /* }}} */ -ZEND_API int zend_is_true(zval *op TSRMLS_DC) /* {{{ */ +ZEND_API int zend_is_true(zval *op) /* {{{ */ { - return i_zend_is_true(op TSRMLS_CC); + return i_zend_is_true(op); } /* }}} */ -- cgit v1.2.1 From 8ee2a4a9b5de682c0b37670e1f4f86242b1650ce Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Sat, 16 Aug 2014 11:16:11 +0200 Subject: first shot on merging the core fro the int64 branch --- Zend/zend_execute_API.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'Zend/zend_execute_API.c') diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index 8af877215c..1b33903723 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -531,11 +531,11 @@ ZEND_API int zval_update_constant_ex(zval *p, zend_bool inline_change, zend_clas if (!const_value) { char *actual = Z_STRVAL_P(p); - if ((colon = (char*)zend_memrchr(Z_STRVAL_P(p), ':', Z_STRLEN_P(p)))) { + if ((colon = (char*)zend_memrchr(Z_STRVAL_P(p), ':', Z_STRSIZE_P(p)))) { int len; zend_error(E_ERROR, "Undefined class constant '%s'", Z_STRVAL_P(p)); - len = Z_STRLEN_P(p) - ((colon - Z_STRVAL_P(p)) + 1); + len = Z_STRSIZE_P(p) - ((colon - Z_STRVAL_P(p)) + 1); if (inline_change) { zend_string *tmp = STR_INIT(colon + 1, len, 0); STR_RELEASE(Z_STR_P(p)); @@ -547,7 +547,7 @@ ZEND_API int zval_update_constant_ex(zval *p, zend_bool inline_change, zend_clas } else { zend_string *save = Z_STR_P(p); char *slash; - int actual_len = Z_STRLEN_P(p); + int actual_len = Z_STRSIZE_P(p); if ((Z_CONST_FLAGS_P(p) & IS_CONSTANT_UNQUALIFIED) && (slash = (char *)zend_memrchr(actual, '\\', actual_len))) { actual = slash + 1; actual_len -= (actual - Z_STRVAL_P(p)); @@ -559,8 +559,8 @@ ZEND_API int zval_update_constant_ex(zval *p, zend_bool inline_change, zend_clas } if (actual[0] == '\\') { if (inline_change) { - memmove(Z_STRVAL_P(p), Z_STRVAL_P(p)+1, Z_STRLEN_P(p)); - --Z_STRLEN_P(p); + memmove(Z_STRVAL_P(p), Z_STRVAL_P(p)+1, Z_STRSIZE_P(p)); + --Z_STRSIZE_P(p); } else { ++actual; } @@ -1069,8 +1069,8 @@ ZEND_API int zend_eval_stringl(char *str, int str_len, zval *retval_ptr, char *s ZVAL_NEW_STR(&pv, STR_ALLOC(str_len + sizeof("return ;")-1, 1)); memcpy(Z_STRVAL(pv), "return ", sizeof("return ") - 1); memcpy(Z_STRVAL(pv) + sizeof("return ") - 1, str, str_len); - Z_STRVAL(pv)[Z_STRLEN(pv) - 1] = ';'; - Z_STRVAL(pv)[Z_STRLEN(pv)] = '\0'; + Z_STRVAL(pv)[Z_STRSIZE(pv) - 1] = ';'; + Z_STRVAL(pv)[Z_STRSIZE(pv)] = '\0'; } else { ZVAL_STRINGL(&pv, str, str_len); } @@ -1183,7 +1183,7 @@ void execute_new_code(TSRMLS_D) /* {{{ */ } switch (opline->opcode) { case ZEND_GOTO: - if (Z_TYPE_P(opline->op2.zv) != IS_LONG) { + if (Z_TYPE_P(opline->op2.zv) != IS_INT) { zend_resolve_goto_label(CG(active_op_array), opline, 1 TSRMLS_CC); } /* break omitted intentionally */ @@ -1360,7 +1360,7 @@ void zend_shutdown_timeout_thread(void) /* {{{ */ #define SIGPROF 27 #endif -void zend_set_timeout(long seconds, int reset_signals) /* {{{ */ +void zend_set_timeout(zend_int_t seconds, int reset_signals) /* {{{ */ { TSRMLS_FETCH(); -- cgit v1.2.1 From 5bb25776a00e1074d1230a311043b00f7cce9252 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Sat, 16 Aug 2014 15:34:04 +0200 Subject: further fixes on core --- Zend/zend_execute_API.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Zend/zend_execute_API.c') diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index 1b33903723..eba2d39c5f 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -1680,7 +1680,7 @@ ZEND_API int zend_set_local_var(zend_string *name, zval *value, int force TSRMLS if (execute_data) { if (!execute_data->symbol_table) { - zend_ulong h = STR_HASH_VAL(name); + zend_uint_t h = STR_HASH_VAL(name); zend_op_array *op_array = &execute_data->func->op_array; int i; @@ -1716,7 +1716,7 @@ ZEND_API int zend_set_local_var_str(const char *name, int len, zval *value, int if (execute_data) { if (!execute_data->symbol_table) { - zend_ulong h = zend_hash_func(name, len); + zend_uint_t h = zend_hash_func(name, len); zend_op_array *op_array = &execute_data->func->op_array; int i; -- cgit v1.2.1 From c3e3c98ec666812daaaca896cf5ef758a8a6df14 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Mon, 25 Aug 2014 19:24:55 +0200 Subject: master renames phase 1 --- Zend/zend_execute_API.c | 64 ++++++++++++++++++++++++------------------------- 1 file changed, 32 insertions(+), 32 deletions(-) (limited to 'Zend/zend_execute_API.c') diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index d2a704259b..c8a3c41afa 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -531,36 +531,36 @@ ZEND_API int zval_update_constant_ex(zval *p, zend_bool inline_change, zend_clas if (!const_value) { char *actual = Z_STRVAL_P(p); - if ((colon = (char*)zend_memrchr(Z_STRVAL_P(p), ':', Z_STRSIZE_P(p)))) { + if ((colon = (char*)zend_memrchr(Z_STRVAL_P(p), ':', Z_STRLEN_P(p)))) { int len; zend_error(E_ERROR, "Undefined class constant '%s'", Z_STRVAL_P(p)); - len = Z_STRSIZE_P(p) - ((colon - Z_STRVAL_P(p)) + 1); + len = Z_STRLEN_P(p) - ((colon - Z_STRVAL_P(p)) + 1); if (inline_change) { - zend_string *tmp = STR_INIT(colon + 1, len, 0); - STR_RELEASE(Z_STR_P(p)); + zend_string *tmp = zend_string_init(colon + 1, len, 0); + zend_string_release(Z_STR_P(p)); Z_STR_P(p) = tmp; } else { - Z_STR_P(p) = STR_INIT(colon + 1, len, 0); + Z_STR_P(p) = zend_string_init(colon + 1, len, 0); } Z_TYPE_FLAGS_P(p) = IS_TYPE_REFCOUNTED | IS_TYPE_COPYABLE; } else { zend_string *save = Z_STR_P(p); char *slash; - int actual_len = Z_STRSIZE_P(p); + int actual_len = Z_STRLEN_P(p); if ((Z_CONST_FLAGS_P(p) & IS_CONSTANT_UNQUALIFIED) && (slash = (char *)zend_memrchr(actual, '\\', actual_len))) { actual = slash + 1; actual_len -= (actual - Z_STRVAL_P(p)); if (inline_change) { - zend_string *s = STR_INIT(actual, actual_len, 0); + zend_string *s = zend_string_init(actual, actual_len, 0); Z_STR_P(p) = s; Z_TYPE_FLAGS_P(p) = IS_TYPE_REFCOUNTED | IS_TYPE_COPYABLE; } } if (actual[0] == '\\') { if (inline_change) { - memmove(Z_STRVAL_P(p), Z_STRVAL_P(p)+1, Z_STRSIZE_P(p)); - --Z_STRSIZE_P(p); + memmove(Z_STRVAL_P(p), Z_STRVAL_P(p)+1, Z_STRLEN_P(p)); + --Z_STRLEN_P(p); } else { ++actual; } @@ -573,7 +573,7 @@ ZEND_API int zval_update_constant_ex(zval *p, zend_bool inline_change, zend_clas zend_error(E_ERROR, "Undefined constant '%s'", save->val); } if (inline_change) { - STR_RELEASE(save); + zend_string_release(save); } save = NULL; } @@ -584,13 +584,13 @@ ZEND_API int zval_update_constant_ex(zval *p, zend_bool inline_change, zend_clas Z_TYPE_INFO_P(p) = IS_INTERNED(Z_STR_P(p)) ? IS_INTERNED_STRING_EX : IS_STRING_EX; if (save && save->val != actual) { - STR_RELEASE(save); + zend_string_release(save); } } } } else { if (inline_change) { - STR_RELEASE(Z_STR_P(p)); + zend_string_release(Z_STR_P(p)); } ZVAL_COPY_VALUE(p, const_value); if (Z_OPT_CONSTANT_P(p)) { @@ -724,7 +724,7 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS efree(error); } if (callable_name) { - STR_RELEASE(callable_name); + zend_string_release(callable_name); } if (EG(current_execute_data) == &dummy_execute_data) { EG(current_execute_data) = dummy_execute_data.prev_execute_data; @@ -738,7 +738,7 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS zend_error(E_STRICT, "%s", error); efree(error); } - STR_RELEASE(callable_name); + zend_string_release(callable_name); } func = fci_cache->function_handler; @@ -903,7 +903,7 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS zend_vm_stack_free_call_frame(call TSRMLS_CC); if (func->type == ZEND_OVERLOADED_FUNCTION_TEMPORARY) { - STR_RELEASE(func->common.function_name); + zend_string_release(func->common.function_name); } efree(func); @@ -948,10 +948,10 @@ ZEND_API zend_class_entry *zend_lookup_class_ex(zend_string *name, const zval *k } if (name->val[0] == '\\') { - lc_name = STR_ALLOC(name->len - 1, 0); + lc_name = zend_string_alloc(name->len - 1, 0); zend_str_tolower_copy(lc_name->val, name->val + 1, name->len - 1); } else { - lc_name = STR_ALLOC(name->len, 0); + lc_name = zend_string_alloc(name->len, 0); zend_str_tolower_copy(lc_name->val, name->val, name->len); } } @@ -959,7 +959,7 @@ ZEND_API zend_class_entry *zend_lookup_class_ex(zend_string *name, const zval *k ce = zend_hash_find_ptr(EG(class_table), lc_name); if (ce) { if (!key) { - STR_FREE(lc_name); + zend_string_free(lc_name); } return ce; } @@ -969,7 +969,7 @@ ZEND_API zend_class_entry *zend_lookup_class_ex(zend_string *name, const zval *k */ if (!use_autoload || zend_is_compiling(TSRMLS_C)) { if (!key) { - STR_FREE(lc_name); + zend_string_free(lc_name); } return NULL; } @@ -980,7 +980,7 @@ ZEND_API zend_class_entry *zend_lookup_class_ex(zend_string *name, const zval *k EG(autoload_func) = func; } else { if (!key) { - STR_FREE(lc_name); + zend_string_free(lc_name); } return NULL; } @@ -990,7 +990,7 @@ ZEND_API zend_class_entry *zend_lookup_class_ex(zend_string *name, const zval *k /* Verify class name before passing it to __autoload() */ if (strspn(name->val, "0123456789_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\177\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377\\") != name->len) { if (!key) { - STR_FREE(lc_name); + zend_string_free(lc_name); } return NULL; } @@ -1002,7 +1002,7 @@ ZEND_API zend_class_entry *zend_lookup_class_ex(zend_string *name, const zval *k if (zend_hash_add_empty_element(EG(in_autoload), lc_name) == NULL) { if (!key) { - STR_FREE(lc_name); + zend_string_free(lc_name); } return NULL; } @@ -1012,12 +1012,12 @@ ZEND_API zend_class_entry *zend_lookup_class_ex(zend_string *name, const zval *k if (name->val[0] == '\\') { ZVAL_STRINGL(&args[0], name->val + 1, name->len - 1); } else { - ZVAL_STR(&args[0], STR_COPY(name)); + ZVAL_STR(&args[0], zend_string_copy(name)); } fcall_info.size = sizeof(fcall_info); fcall_info.function_table = EG(function_table); - ZVAL_STR(&fcall_info.function_name, STR_COPY(EG(autoload_func)->common.function_name)); + ZVAL_STR(&fcall_info.function_name, zend_string_copy(EG(autoload_func)->common.function_name)); fcall_info.symbol_table = NULL; fcall_info.retval = &local_retval; fcall_info.param_count = 1; @@ -1046,7 +1046,7 @@ ZEND_API zend_class_entry *zend_lookup_class_ex(zend_string *name, const zval *k ce = zend_hash_find_ptr(EG(class_table), lc_name); } if (!key) { - STR_FREE(lc_name); + zend_string_free(lc_name); } return ce; } @@ -1066,11 +1066,11 @@ ZEND_API int zend_eval_stringl(char *str, int str_len, zval *retval_ptr, char *s int retval; if (retval_ptr) { - ZVAL_NEW_STR(&pv, STR_ALLOC(str_len + sizeof("return ;")-1, 1)); + ZVAL_NEW_STR(&pv, zend_string_alloc(str_len + sizeof("return ;")-1, 1)); memcpy(Z_STRVAL(pv), "return ", sizeof("return ") - 1); memcpy(Z_STRVAL(pv) + sizeof("return ") - 1, str, str_len); - Z_STRVAL(pv)[Z_STRSIZE(pv) - 1] = ';'; - Z_STRVAL(pv)[Z_STRSIZE(pv)] = '\0'; + Z_STRVAL(pv)[Z_STRLEN(pv) - 1] = ';'; + Z_STRVAL(pv)[Z_STRLEN(pv)] = '\0'; } else { ZVAL_STRINGL(&pv, str, str_len); } @@ -1183,7 +1183,7 @@ void execute_new_code(TSRMLS_D) /* {{{ */ } switch (opline->opcode) { case ZEND_GOTO: - if (Z_TYPE_P(opline->op2.zv) != IS_INT) { + if (Z_TYPE_P(opline->op2.zv) != IS_LONG) { zend_resolve_goto_label(CG(active_op_array), opline, 1 TSRMLS_CC); } /* break omitted intentionally */ @@ -1360,7 +1360,7 @@ void zend_shutdown_timeout_thread(void) /* {{{ */ #define SIGPROF 27 #endif -void zend_set_timeout(zend_int_t seconds, int reset_signals) /* {{{ */ +void zend_set_timeout(zend_long seconds, int reset_signals) /* {{{ */ { TSRMLS_FETCH(); @@ -1680,7 +1680,7 @@ ZEND_API int zend_set_local_var(zend_string *name, zval *value, int force TSRMLS if (execute_data) { if (!execute_data->symbol_table) { - zend_uint_t h = STR_HASH_VAL(name); + zend_ulong h = zend_string_hash_val(name); zend_op_array *op_array = &execute_data->func->op_array; int i; @@ -1716,7 +1716,7 @@ ZEND_API int zend_set_local_var_str(const char *name, int len, zval *value, int if (execute_data) { if (!execute_data->symbol_table) { - zend_uint_t h = zend_hash_func(name, len); + zend_ulong h = zend_hash_func(name, len); zend_op_array *op_array = &execute_data->func->op_array; int i; -- cgit v1.2.1 From 6f9f0bf2056f0dc17d9bcc6dd3b7d28ac878c6fc Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Mon, 25 Aug 2014 19:28:33 +0200 Subject: master renames phase 2 --- Zend/zend_execute_API.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'Zend/zend_execute_API.c') diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index c8a3c41afa..af309c5e64 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -633,13 +633,13 @@ ZEND_API int zval_update_constant(zval *pp, zend_bool inline_change TSRMLS_DC) / } /* }}} */ -int call_user_function(HashTable *function_table, zval *object, zval *function_name, zval *retval_ptr, zend_uint param_count, zval params[] TSRMLS_DC) /* {{{ */ +int call_user_function(HashTable *function_table, zval *object, zval *function_name, zval *retval_ptr, uint32_t param_count, zval params[] TSRMLS_DC) /* {{{ */ { return call_user_function_ex(function_table, object, function_name, retval_ptr, param_count, params, 1, NULL TSRMLS_CC); } /* }}} */ -int call_user_function_ex(HashTable *function_table, zval *object, zval *function_name, zval *retval_ptr, zend_uint param_count, zval params[], int no_separation, zend_array *symbol_table TSRMLS_DC) /* {{{ */ +int call_user_function_ex(HashTable *function_table, zval *object, zval *function_name, zval *retval_ptr, uint32_t param_count, zval params[], int no_separation, zend_array *symbol_table TSRMLS_DC) /* {{{ */ { zend_fcall_info fci; @@ -659,7 +659,7 @@ int call_user_function_ex(HashTable *function_table, zval *object, zval *functio int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TSRMLS_DC) /* {{{ */ { - zend_uint i; + uint32_t i; zend_class_entry *calling_scope = NULL; zend_execute_data *call, dummy_execute_data; zend_fcall_info_cache fci_cache_local; @@ -1062,7 +1062,7 @@ ZEND_API int zend_eval_stringl(char *str, int str_len, zval *retval_ptr, char *s { zval pv; zend_op_array *new_op_array; - zend_uint original_compiler_options; + uint32_t original_compiler_options; int retval; if (retval_ptr) { @@ -1584,7 +1584,7 @@ ZEND_API int zend_delete_global_variable(zend_string *name TSRMLS_DC) /* {{{ */ ZEND_API zend_array *zend_rebuild_symbol_table(TSRMLS_D) /* {{{ */ { - zend_uint i; + uint32_t i; zend_execute_data *ex; zend_array *symbol_table; -- cgit v1.2.1