summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikita Popov <nikic@php.net>2014-04-09 15:51:28 +0200
committerNikita Popov <nikic@php.net>2014-04-09 23:41:16 +0200
commit20f2e5986e7d9e5978eaed8d6d60cd6bf917ea37 (patch)
tree0c3237e875f1e40fc4aa5daf1a971a1f7187c84d
parent2016e72111f371e8e4d96f6d7cb870ca0e673175 (diff)
downloadphp-git-20f2e5986e7d9e5978eaed8d6d60cd6bf917ea37.tar.gz
Fix ZTS build
This only makes it compile, it doesn't actually work, presumably because interned strings are assumed in some places.
-rw-r--r--Zend/zend.c16
-rw-r--r--Zend/zend_API.c18
-rw-r--r--Zend/zend_API.h6
-rw-r--r--Zend/zend_builtin_functions.c2
-rw-r--r--Zend/zend_compile.c33
-rw-r--r--Zend/zend_compile.h2
-rw-r--r--Zend/zend_globals.h2
-rw-r--r--Zend/zend_ini.c4
-rw-r--r--Zend/zend_iterators.c2
-rw-r--r--Zend/zend_language_parser.y8
-rw-r--r--Zend/zend_objects.c4
-rw-r--r--Zend/zend_operators.c5
-rw-r--r--Zend/zend_string.c2
-rw-r--r--ext/date/php_date.c20
-rw-r--r--ext/reflection/php_reflection.c12
-rw-r--r--ext/spl/spl_array.c2
-rw-r--r--ext/spl/spl_directory.c20
-rw-r--r--ext/spl/spl_heap.c2
-rw-r--r--ext/spl/spl_iterators.c4
-rw-r--r--ext/standard/math.c10
-rw-r--r--ext/standard/php_math.h2
-rw-r--r--ext/standard/string.c15
22 files changed, 85 insertions, 106 deletions
diff --git a/Zend/zend.c b/Zend/zend.c
index 2df674a8d5..1fd8b4840b 100644
--- a/Zend/zend.c
+++ b/Zend/zend.c
@@ -235,14 +235,17 @@ ZEND_API void zend_make_printable_zval(zval *expr, zval *expr_copy, int *use_cop
again:
switch (Z_TYPE_P(expr)) {
- case IS_NULL:
+ case IS_NULL: {
+ TSRMLS_FETCH();
ZVAL_EMPTY_STRING(expr_copy);
break;
+ }
case IS_BOOL:
if (Z_LVAL_P(expr)) {
// TODO: ??? use interned string
ZVAL_NEW_STR(expr_copy, STR_INIT("1", 1, 0));
} else {
+ TSRMLS_FETCH();
ZVAL_EMPTY_STRING(expr_copy);
}
break;
@@ -514,14 +517,11 @@ static void zend_init_exception_op(TSRMLS_D) /* {{{ */
#ifdef ZTS
static void compiler_globals_ctor(zend_compiler_globals *compiler_globals TSRMLS_DC) /* {{{ */
{
- zend_function tmp_func;
- zend_class_entry *tmp_class;
-
compiler_globals->compiled_filename = NULL;
compiler_globals->function_table = (HashTable *) malloc(sizeof(HashTable));
zend_hash_init_ex(compiler_globals->function_table, 100, NULL, ZEND_FUNCTION_DTOR, 1, 0);
- zend_hash_copy(compiler_globals->function_table, global_function_table, NULL, &tmp_func, sizeof(zend_function));
+ zend_hash_copy(compiler_globals->function_table, global_function_table, NULL);
compiler_globals->class_table = (HashTable *) malloc(sizeof(HashTable));
zend_hash_init_ex(compiler_globals->class_table, 10, NULL, ZEND_CLASS_DTOR, 1, 0);
@@ -533,7 +533,7 @@ static void compiler_globals_ctor(zend_compiler_globals *compiler_globals TSRMLS
compiler_globals->auto_globals = (HashTable *) malloc(sizeof(HashTable));
zend_hash_init_ex(compiler_globals->auto_globals, 8, NULL, NULL, 1, 0);
- zend_hash_copy(compiler_globals->auto_globals, global_auto_globals_table, NULL, NULL, sizeof(zend_auto_global) /* empty element */);
+ zend_hash_copy(compiler_globals->auto_globals, global_auto_globals_table, NULL /* empty element */);
compiler_globals->last_static_member = zend_hash_num_elements(compiler_globals->class_table);
if (compiler_globals->last_static_member) {
@@ -576,8 +576,8 @@ static void executor_globals_ctor(zend_executor_globals *executor_globals TSRMLS
zend_init_rsrc_plist(TSRMLS_C);
zend_init_exception_op(TSRMLS_C);
EG(lambda_count) = 0;
- EG(user_error_handler) = NULL;
- EG(user_exception_handler) = NULL;
+ ZVAL_UNDEF(&EG(user_error_handler));
+ ZVAL_UNDEF(&EG(user_exception_handler));
EG(in_execution) = 0;
EG(in_autoload) = NULL;
EG(current_execute_data) = NULL;
diff --git a/Zend/zend_API.c b/Zend/zend_API.c
index d9e926b685..1ce9f11b11 100644
--- a/Zend/zend_API.c
+++ b/Zend/zend_API.c
@@ -1207,22 +1207,18 @@ ZEND_API void object_properties_init(zend_object *object, zend_class_entry *clas
if (class_type->default_properties_count) {
//??? object->properties_table = emalloc(sizeof(zval*) * class_type->default_properties_count);
for (i = 0; i < class_type->default_properties_count; i++) {
- ZVAL_COPY_VALUE(&object->properties_table[i], &class_type->default_properties_table[i]);
- if (Z_REFCOUNTED(class_type->default_properties_table[i])) {
#if ZTS
- ALLOC_ZVAL( object->properties_table[i]);
- MAKE_COPY_ZVAL(&class_type->default_properties_table[i], object->properties_table[i]);
+ ZVAL_DUP(&object->properties_table[i], &class_type->default_properties_table[i]);
#else
- Z_ADDREF(object->properties_table[i]);
+ ZVAL_COPY(&object->properties_table[i], &class_type->default_properties_table[i]);
#endif
- }
}
object->properties = NULL;
}
}
/* }}} */
-ZEND_API void object_properties_init_ex(zend_object *object, HashTable *properties) /* {{{ */
+ZEND_API void object_properties_init_ex(zend_object *object, HashTable *properties TSRMLS_DC) /* {{{ */
{
object->properties = properties;
if (object->ce->default_properties_count) {
@@ -1250,7 +1246,7 @@ ZEND_API void object_properties_init_ex(zend_object *object, HashTable *properti
}
/* }}} */
-ZEND_API void object_properties_load(zend_object *object, HashTable *properties) /* {{{ */
+ZEND_API void object_properties_load(zend_object *object, HashTable *properties TSRMLS_DC) /* {{{ */
{
HashPosition pos;
zval *prop, tmp;
@@ -1304,7 +1300,7 @@ ZEND_API int _object_and_properties_init(zval *arg, zend_class_entry *class_type
if (class_type->create_object == NULL) {
ZVAL_OBJ(arg, zend_objects_new(class_type TSRMLS_CC));
if (properties) {
- object_properties_init_ex(Z_OBJ_P(arg), properties);
+ object_properties_init_ex(Z_OBJ_P(arg), properties TSRMLS_CC);
} else {
object_properties_init(Z_OBJ_P(arg), class_type);
}
@@ -1656,7 +1652,7 @@ ZEND_API zval *add_get_index_stringl(zval *arg, ulong index, const char *str, ui
}
/* }}} */
-ZEND_API int array_set_zval_key(HashTable *ht, zval *key, zval *value) /* {{{ */
+ZEND_API int array_set_zval_key(HashTable *ht, zval *key, zval *value TSRMLS_DC) /* {{{ */
{
zval *result;
@@ -2171,7 +2167,7 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, const zend_functio
while (ptr->fname) {
fname_len = strlen(ptr->fname);
internal_function->handler = ptr->handler;
- internal_function->function_name = zend_new_interned_string(STR_INIT(ptr->fname, fname_len, 1));
+ internal_function->function_name = zend_new_interned_string(STR_INIT(ptr->fname, fname_len, 1) TSRMLS_CC);
internal_function->scope = scope;
internal_function->prototype = NULL;
if (ptr->flags) {
diff --git a/Zend/zend_API.h b/Zend/zend_API.h
index 01ab9892e2..b1c36b268a 100644
--- a/Zend/zend_API.h
+++ b/Zend/zend_API.h
@@ -366,8 +366,8 @@ ZEND_API int _object_init(zval *arg ZEND_FILE_LINE_DC TSRMLS_DC);
ZEND_API int _object_init_ex(zval *arg, zend_class_entry *ce ZEND_FILE_LINE_DC TSRMLS_DC);
ZEND_API int _object_and_properties_init(zval *arg, zend_class_entry *ce, HashTable *properties ZEND_FILE_LINE_DC TSRMLS_DC);
ZEND_API void object_properties_init(zend_object *object, zend_class_entry *class_type);
-ZEND_API void object_properties_init_ex(zend_object *object, HashTable *properties);
-ZEND_API void object_properties_load(zend_object *object, HashTable *properties);
+ZEND_API void object_properties_init_ex(zend_object *object, HashTable *properties TSRMLS_DC);
+ZEND_API void object_properties_load(zend_object *object, HashTable *properties TSRMLS_DC);
ZEND_API void zend_merge_properties(zval *obj, HashTable *properties, int destroy_ht TSRMLS_DC);
@@ -432,7 +432,7 @@ ZEND_API zval *add_get_index_str(zval *arg, ulong index, zend_string *str);
ZEND_API zval *add_get_index_string(zval *arg, ulong idx, const char *str, int duplicate);
ZEND_API zval *add_get_index_stringl(zval *arg, ulong idx, const char *str, uint length, int duplicate);
-ZEND_API int array_set_zval_key(HashTable *ht, zval *key, zval *value);
+ZEND_API int array_set_zval_key(HashTable *ht, zval *key, zval *value TSRMLS_DC);
ZEND_API int add_property_long_ex(zval *arg, const char *key, uint key_len, long l TSRMLS_DC);
ZEND_API int add_property_null_ex(zval *arg, const char *key, uint key_len TSRMLS_DC);
diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c
index b453676d63..b75343936c 100644
--- a/Zend/zend_builtin_functions.c
+++ b/Zend/zend_builtin_functions.c
@@ -2290,7 +2290,7 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last, int
if (ptr->function_state.arguments) {
zval args;
debug_backtrace_get_args(ptr->function_state.arguments, &args TSRMLS_CC);
- add_assoc_zval_ex(&stack_frame, "args", sizeof("args")-1, &args TSRMLS_CC);
+ add_assoc_zval_ex(&stack_frame, "args", sizeof("args")-1, &args);
}
}
} else {
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index d4305a042c..f5fda549b6 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -3733,17 +3733,8 @@ ZEND_API void zend_do_inherit_interfaces(zend_class_entry *ce, const zend_class_
/* }}} */
#ifdef ZTS
-static void zval_internal_ctor(zval **p) /* {{{ */
-{
- zval *orig_ptr = *p;
-
- ALLOC_ZVAL(*p);
- MAKE_COPY_ZVAL(&orig_ptr, *p);
-}
-/* }}} */
-
# define zval_property_ctor(parent_ce, ce) \
- (((parent_ce)->type != (ce)->type) ? zval_internal_ctor : zval_add_ref))
+ (((parent_ce)->type != (ce)->type) ? ZVAL_COPY_CTOR : zval_add_ref)
#else
# define zval_property_ctor(parent_ce, ce) \
zval_add_ref
@@ -3784,22 +3775,14 @@ ZEND_API void zend_do_inheritance(zend_class_entry *ce, zend_class_entry *parent
}
}
for (i = 0; i < parent_ce->default_properties_count; i++) {
- ZVAL_COPY_VALUE(&ce->default_properties_table[i], &parent_ce->default_properties_table[i]);
- if (Z_REFCOUNTED(ce->default_properties_table[i])) {
#ifdef ZTS
- if (parent_ce->type != ce->type) {
- zval *p;
-
- ALLOC_ZVAL(p);
- MAKE_COPY_ZVAL(&ce->default_properties_table[i], p);
- ce->default_properties_table[i] = p;
- } else {
- Z_ADDREF_P(ce->default_properties_table[i]);
- }
-#else
- Z_ADDREF(ce->default_properties_table[i]);
-#endif
+ if (parent_ce->type != ce->type) {
+ ZVAL_DUP(&ce->default_properties_table[i], &parent_ce->default_properties_table[i]);
+ continue;
}
+#endif
+
+ ZVAL_COPY(&ce->default_properties_table[i], &parent_ce->default_properties_table[i]);
}
ce->default_properties_count += parent_ce->default_properties_count;
}
@@ -5921,7 +5904,7 @@ void zend_do_add_array_element(znode *result, const znode *expr, const znode *of
}
/* }}} */
-void zend_do_add_static_array_element(znode *result, znode *offset, const znode *expr) /* {{{ */
+void zend_do_add_static_array_element(znode *result, znode *offset, const znode *expr TSRMLS_DC) /* {{{ */
{
zval element;
diff --git a/Zend/zend_compile.h b/Zend/zend_compile.h
index 33f1007257..eb30107d21 100644
--- a/Zend/zend_compile.h
+++ b/Zend/zend_compile.h
@@ -582,7 +582,7 @@ void zend_do_shell_exec(znode *result, const znode *cmd TSRMLS_DC);
void zend_do_init_array(znode *result, const znode *expr, const znode *offset, zend_bool is_ref TSRMLS_DC);
void zend_do_add_array_element(znode *result, const znode *expr, const znode *offset, zend_bool is_ref TSRMLS_DC);
-void zend_do_add_static_array_element(znode *result, znode *offset, const znode *expr);
+void zend_do_add_static_array_element(znode *result, znode *offset, const znode *expr TSRMLS_DC);
void zend_do_list_init(TSRMLS_D);
void zend_do_list_end(znode *result, znode *expr TSRMLS_DC);
void zend_do_add_list_element(const znode *element TSRMLS_DC);
diff --git a/Zend/zend_globals.h b/Zend/zend_globals.h
index 828acfa106..2a29e337de 100644
--- a/Zend/zend_globals.h
+++ b/Zend/zend_globals.h
@@ -152,7 +152,7 @@ struct _zend_compiler_globals {
zend_bool encoding_declared;
#ifdef ZTS
- zval ***static_members_table;
+ zval **static_members_table;
int last_static_member;
#endif
};
diff --git a/Zend/zend_ini.c b/Zend/zend_ini.c
index 882049830b..4ac379ca91 100644
--- a/Zend/zend_ini.c
+++ b/Zend/zend_ini.c
@@ -137,15 +137,13 @@ ZEND_API int zend_ini_deactivate(TSRMLS_D) /* {{{ */
#ifdef ZTS
ZEND_API int zend_copy_ini_directives(TSRMLS_D) /* {{{ */
{
- zend_ini_entry ini_entry;
-
EG(modified_ini_directives) = NULL;
EG(error_reporting_ini_entry) = NULL;
EG(ini_directives) = (HashTable *) malloc(sizeof(HashTable));
if (zend_hash_init_ex(EG(ini_directives), registered_zend_ini_directives->nNumOfElements, NULL, NULL, 1, 0) == FAILURE) {
return FAILURE;
}
- zend_hash_copy(EG(ini_directives), registered_zend_ini_directives, NULL, &ini_entry, sizeof(zend_ini_entry));
+ zend_hash_copy(EG(ini_directives), registered_zend_ini_directives, NULL);
return SUCCESS;
}
/* }}} */
diff --git a/Zend/zend_iterators.c b/Zend/zend_iterators.c
index 9fa4084d63..b626ef5e35 100644
--- a/Zend/zend_iterators.c
+++ b/Zend/zend_iterators.c
@@ -68,7 +68,7 @@ static void iter_wrapper_dtor(zend_object *object TSRMLS_DC)
ZEND_API void zend_iterator_init(zend_object_iterator *iter TSRMLS_DC)
{
- zend_object_std_init(&iter->std, &zend_iterator_class_entry);
+ zend_object_std_init(&iter->std, &zend_iterator_class_entry TSRMLS_CC);
iter->std.handlers = &iterator_object_handlers;
}
diff --git a/Zend/zend_language_parser.y b/Zend/zend_language_parser.y
index c50593692b..05cfaafc7e 100644
--- a/Zend/zend_language_parser.y
+++ b/Zend/zend_language_parser.y
@@ -1056,10 +1056,10 @@ possible_comma:
;
non_empty_static_array_pair_list:
- non_empty_static_array_pair_list ',' static_scalar T_DOUBLE_ARROW static_scalar { zend_do_add_static_array_element(&$$, &$3, &$5); }
- | non_empty_static_array_pair_list ',' static_scalar { zend_do_add_static_array_element(&$$, NULL, &$3); }
- | static_scalar T_DOUBLE_ARROW static_scalar { $$.op_type = IS_CONST; array_init(&$$.u.constant); zend_do_add_static_array_element(&$$, &$1, &$3); }
- | static_scalar { $$.op_type = IS_CONST; array_init(&$$.u.constant); zend_do_add_static_array_element(&$$, NULL, &$1); }
+ non_empty_static_array_pair_list ',' static_scalar T_DOUBLE_ARROW static_scalar { zend_do_add_static_array_element(&$$, &$3, &$5 TSRMLS_CC); }
+ | non_empty_static_array_pair_list ',' static_scalar { zend_do_add_static_array_element(&$$, NULL, &$3 TSRMLS_CC); }
+ | static_scalar T_DOUBLE_ARROW static_scalar { $$.op_type = IS_CONST; array_init(&$$.u.constant); zend_do_add_static_array_element(&$$, &$1, &$3 TSRMLS_CC); }
+ | static_scalar { $$.op_type = IS_CONST; array_init(&$$.u.constant); zend_do_add_static_array_element(&$$, NULL, &$1 TSRMLS_CC); }
;
expr:
diff --git a/Zend/zend_objects.c b/Zend/zend_objects.c
index 34a4ddf4a7..37423b3dd8 100644
--- a/Zend/zend_objects.c
+++ b/Zend/zend_objects.c
@@ -33,7 +33,7 @@ ZEND_API void zend_object_std_init(zend_object *object, zend_class_entry *ce TSR
object->ce = ce;
object->properties = NULL;
object->guards = NULL;
- zend_objects_store_put(object);
+ zend_objects_store_put(object TSRMLS_CC);
if (EXPECTED(ce->default_properties_count != 0)) {
zval *p = object->properties_table;
zval *end = p + ce->default_properties_count;
@@ -132,7 +132,7 @@ ZEND_API zend_object *zend_objects_new(zend_class_entry *ce TSRMLS_DC)
{
zend_object *object = emalloc(sizeof(zend_object) + sizeof(zval) * (ce->default_properties_count - 1));
- zend_object_std_init(object, ce);
+ zend_object_std_init(object, ce TSRMLS_CC);
object->handlers = &std_object_handlers;
return object;
}
diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c
index 93d7652436..f6c2a9161f 100644
--- a/Zend/zend_operators.c
+++ b/Zend/zend_operators.c
@@ -611,15 +611,18 @@ ZEND_API void _convert_to_string(zval *op ZEND_FILE_LINE_DC) /* {{{ */
double dval;
switch (Z_TYPE_P(op)) {
- case IS_NULL:
+ case IS_NULL: {
+ TSRMLS_FETCH();
ZVAL_EMPTY_STRING(op);
break;
+ }
case IS_STRING:
break;
case IS_BOOL:
if (Z_LVAL_P(op)) {
ZVAL_NEW_STR(op, STR_INIT("1", 1, 0));
} else {
+ TSRMLS_FETCH();
ZVAL_EMPTY_STRING(op);
}
break;
diff --git a/Zend/zend_string.c b/Zend/zend_string.c
index ee4fe02a82..d95d0e9e15 100644
--- a/Zend/zend_string.c
+++ b/Zend/zend_string.c
@@ -43,9 +43,9 @@ static void _str_dtor(zval *zv)
void zend_interned_strings_init(TSRMLS_D)
{
-#ifndef ZTS
zend_string *str;
+#ifndef ZTS
zend_hash_init(&CG(interned_strings), 0, NULL, _str_dtor, 1);
CG(interned_strings).nTableMask = CG(interned_strings).nTableSize - 1;
diff --git a/ext/date/php_date.c b/ext/date/php_date.c
index fa92c3495c..ca58fc1a4a 100644
--- a/ext/date/php_date.c
+++ b/ext/date/php_date.c
@@ -1046,7 +1046,7 @@ char *php_date_short_day_name(timelib_sll y, timelib_sll m, timelib_sll d)
/* }}} */
/* {{{ date_format - (gm)date helper */
-static zend_string *date_format(char *format, int format_len, timelib_time *t, int localtime)
+static zend_string *date_format(char *format, int format_len, timelib_time *t, int localtime TSRMLS_DC)
{
smart_str string = {0};
int i, length = 0;
@@ -1239,7 +1239,7 @@ PHPAPI zend_string *php_format_date(char *format, int format_len, time_t ts, int
timelib_unixtime2gmt(t, ts);
}
- string = date_format(format, format_len, t, localtime);
+ string = date_format(format, format_len, t, localtime TSRMLS_CC);
timelib_time_dtor(t);
return string;
@@ -2191,7 +2191,7 @@ static HashTable *date_object_get_properties(zval *object TSRMLS_DC) /* {{{ */
}
/* first we add the date and time in ISO format */
- ZVAL_STR(&zv, date_format("Y-m-d H:i:s", sizeof("Y-m-d H:i:s")-1, dateobj->time, 1));
+ ZVAL_STR(&zv, date_format("Y-m-d H:i:s", sizeof("Y-m-d H:i:s")-1, dateobj->time, 1 TSRMLS_CC));
zend_hash_str_update(props, "date", sizeof("date")-1, &zv);
/* then we add the timezone name (or similar) */
@@ -2979,7 +2979,7 @@ PHP_FUNCTION(date_format)
}
dateobj = Z_PHPDATE_P(object);
DATE_CHECK_INITIALIZED(dateobj->time, DateTime);
- RETURN_STR(date_format(format, format_len, dateobj->time, dateobj->time->is_localtime));
+ RETURN_STR(date_format(format, format_len, dateobj->time, dateobj->time->is_localtime TSRMLS_CC));
}
/* }}} */
@@ -3550,15 +3550,15 @@ PHP_FUNCTION(date_diff)
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO|l", &object1, date_ce_interface, &object2, date_ce_interface, &absolute) == FAILURE) {
RETURN_FALSE;
}
- dateobj1 = Z_PHPDATE_P(object1 TSRMLS_CC);
- dateobj2 = Z_PHPDATE_P(object2 TSRMLS_CC);
+ dateobj1 = Z_PHPDATE_P(object1);
+ dateobj2 = Z_PHPDATE_P(object2);
DATE_CHECK_INITIALIZED(dateobj1->time, DateTimeInterface);
DATE_CHECK_INITIALIZED(dateobj2->time, DateTimeInterface);
timelib_update_ts(dateobj1->time, NULL);
timelib_update_ts(dateobj2->time, NULL);
php_date_instantiate(date_ce_interval, return_value TSRMLS_CC);
- interval = Z_PHPINTERVAL_P(return_value TSRMLS_CC);
+ interval = Z_PHPINTERVAL_P(return_value);
interval->diff = timelib_diff(dateobj1->time, dateobj2->time);
if (absolute) {
interval->diff->invert = 0;
@@ -3603,7 +3603,7 @@ PHP_FUNCTION(timezone_open)
if (SUCCESS != timezone_initialize(&tzi, tz TSRMLS_CC)) {
RETURN_FALSE;
}
- tzobj = Z_PHPTIMEZONE_P(php_date_instantiate(date_ce_timezone, return_value TSRMLS_CC) TSRMLS_CC);
+ tzobj = Z_PHPTIMEZONE_P(php_date_instantiate(date_ce_timezone, return_value TSRMLS_CC));
tzobj->type = TIMELIB_ZONETYPE_ID;
tzobj->tzi.tz = tzi;
tzobj->initialized = 1;
@@ -4214,7 +4214,7 @@ PHP_FUNCTION(date_interval_create_from_date_string)
/* }}} */
/* {{{ date_interval_format - */
-static zend_string *date_interval_format(char *format, int format_len, timelib_rel_time *t)
+static zend_string *date_interval_format(char *format, int format_len, timelib_rel_time *t TSRMLS_DC)
{
smart_str string = {0};
int i, length, have_format_spec = 0;
@@ -4291,7 +4291,7 @@ PHP_FUNCTION(date_interval_format)
diobj = Z_PHPINTERVAL_P(object);
DATE_CHECK_INITIALIZED(diobj->initialized, DateInterval);
- RETURN_STR(date_interval_format(format, format_len, diobj->diff));
+ RETURN_STR(date_interval_format(format, format_len, diobj->diff TSRMLS_CC));
}
/* }}} */
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c
index 447f17ecae..1ef849f92a 100644
--- a/ext/reflection/php_reflection.c
+++ b/ext/reflection/php_reflection.c
@@ -3104,7 +3104,7 @@ ZEND_METHOD(reflection_function, inNamespace)
if (zend_parse_parameters_none() == FAILURE) {
return;
}
- if ((name = _default_load_entry(getThis(), "name", sizeof("name")-1) TSRMLS_CC) == NULL) {
+ if ((name = _default_load_entry(getThis(), "name", sizeof("name")-1 TSRMLS_CC)) == NULL) {
RETURN_FALSE;
}
if (Z_TYPE_P(name) == IS_STRING
@@ -3127,7 +3127,7 @@ ZEND_METHOD(reflection_function, getNamespaceName)
if (zend_parse_parameters_none() == FAILURE) {
return;
}
- if ((name = _default_load_entry(getThis(), "name", sizeof("name")-1) TSRMLS_CC) == NULL) {
+ if ((name = _default_load_entry(getThis(), "name", sizeof("name")-1 TSRMLS_CC)) == NULL) {
RETURN_FALSE;
}
if (Z_TYPE_P(name) == IS_STRING
@@ -3150,7 +3150,7 @@ ZEND_METHOD(reflection_function, getShortName)
if (zend_parse_parameters_none() == FAILURE) {
return;
}
- if ((name = _default_load_entry(getThis(), "name", sizeof("name")-1) TSRMLS_CC) == NULL) {
+ if ((name = _default_load_entry(getThis(), "name", sizeof("name")-1 TSRMLS_CC)) == NULL) {
RETURN_FALSE;
}
if (Z_TYPE_P(name) == IS_STRING
@@ -4653,7 +4653,7 @@ ZEND_METHOD(reflection_class, inNamespace)
if (zend_parse_parameters_none() == FAILURE) {
return;
}
- if ((name = _default_load_entry(getThis(), "name", sizeof("name")-1) TSRMLS_CC) == NULL) {
+ if ((name = _default_load_entry(getThis(), "name", sizeof("name")-1 TSRMLS_CC)) == NULL) {
RETURN_FALSE;
}
if (Z_TYPE_P(name) == IS_STRING
@@ -4676,7 +4676,7 @@ ZEND_METHOD(reflection_class, getNamespaceName)
if (zend_parse_parameters_none() == FAILURE) {
return;
}
- if ((name = _default_load_entry(getThis(), "name", sizeof("name")-1) TSRMLS_CC) == NULL) {
+ if ((name = _default_load_entry(getThis(), "name", sizeof("name")-1 TSRMLS_CC)) == NULL) {
RETURN_FALSE;
}
if (Z_TYPE_P(name) == IS_STRING
@@ -4699,7 +4699,7 @@ ZEND_METHOD(reflection_class, getShortName)
if (zend_parse_parameters_none() == FAILURE) {
return;
}
- if ((name = _default_load_entry(getThis(), "name", sizeof("name")-1) TSRMLS_CC) == NULL) {
+ if ((name = _default_load_entry(getThis(), "name", sizeof("name")-1 TSRMLS_CC)) == NULL) {
RETURN_FALSE;
}
if (Z_TYPE_P(name) == IS_STRING
diff --git a/ext/spl/spl_array.c b/ext/spl/spl_array.c
index afd3fc6af7..5188ec5565 100644
--- a/ext/spl/spl_array.c
+++ b/ext/spl/spl_array.c
@@ -1799,7 +1799,7 @@ SPL_METHOD(Array, unserialize)
}
/* copy members */
- object_properties_load(&intern->std, Z_ARRVAL(members));
+ object_properties_load(&intern->std, Z_ARRVAL(members) TSRMLS_CC);
zval_ptr_dtor(&members);
/* done reading $serialized */
diff --git a/ext/spl/spl_directory.c b/ext/spl/spl_directory.c
index 1e122774c4..ec74a3cae1 100644
--- a/ext/spl/spl_directory.c
+++ b/ext/spl/spl_directory.c
@@ -1636,7 +1636,7 @@ zend_object_iterator *spl_filesystem_dir_get_iterator(zend_class_entry *ce, zval
zend_error(E_ERROR, "An iterator cannot be used with foreach by reference");
}
dir_object = Z_SPLFILESYSTEM_P(object);
- iterator = spl_filesystem_object_to_iterator(dir_object);
+ iterator = spl_filesystem_object_to_iterator(dir_object TSRMLS_CC);
ZVAL_COPY(&iterator->intern.data, object);
iterator->intern.funcs = &spl_filesystem_dir_it_funcs;
/* ->current must be initialized; rewind doesn't set it and valid
@@ -1667,7 +1667,7 @@ static void spl_filesystem_dir_it_dtor(zend_object_iterator *iter TSRMLS_DC)
/* {{{ spl_filesystem_dir_it_valid */
static int spl_filesystem_dir_it_valid(zend_object_iterator *iter TSRMLS_DC)
{
- spl_filesystem_object *object = spl_filesystem_iterator_to_object((spl_filesystem_iterator *)iter);
+ spl_filesystem_object *object = spl_filesystem_iterator_to_object((spl_filesystem_iterator *)iter TSRMLS_CC);
return object->u.dir.entry.d_name[0] != '\0' ? SUCCESS : FAILURE;
}
@@ -1685,7 +1685,7 @@ static zval *spl_filesystem_dir_it_current_data(zend_object_iterator *iter TSRML
/* {{{ spl_filesystem_dir_it_current_key */
static void spl_filesystem_dir_it_current_key(zend_object_iterator *iter, zval *key TSRMLS_DC)
{
- spl_filesystem_object *object = spl_filesystem_iterator_to_object((spl_filesystem_iterator *)iter);
+ spl_filesystem_object *object = spl_filesystem_iterator_to_object((spl_filesystem_iterator *)iter TSRMLS_CC);
ZVAL_LONG(key, object->u.dir.index);
}
@@ -1694,7 +1694,7 @@ static void spl_filesystem_dir_it_current_key(zend_object_iterator *iter, zval *
/* {{{ spl_filesystem_dir_it_move_forward */
static void spl_filesystem_dir_it_move_forward(zend_object_iterator *iter TSRMLS_DC)
{
- spl_filesystem_object *object = spl_filesystem_iterator_to_object((spl_filesystem_iterator *)iter);
+ spl_filesystem_object *object = spl_filesystem_iterator_to_object((spl_filesystem_iterator *)iter TSRMLS_CC);
object->u.dir.index++;
spl_filesystem_dir_read(object TSRMLS_CC);
@@ -1708,7 +1708,7 @@ static void spl_filesystem_dir_it_move_forward(zend_object_iterator *iter TSRMLS
/* {{{ spl_filesystem_dir_it_rewind */
static void spl_filesystem_dir_it_rewind(zend_object_iterator *iter TSRMLS_DC)
{
- spl_filesystem_object *object = spl_filesystem_iterator_to_object((spl_filesystem_iterator *)iter);
+ spl_filesystem_object *object = spl_filesystem_iterator_to_object((spl_filesystem_iterator *)iter TSRMLS_CC);
object->u.dir.index = 0;
if (object->u.dir.dirp) {
@@ -1739,7 +1739,7 @@ static void spl_filesystem_tree_it_dtor(zend_object_iterator *iter TSRMLS_DC)
static zval *spl_filesystem_tree_it_current_data(zend_object_iterator *iter TSRMLS_DC)
{
spl_filesystem_iterator *iterator = (spl_filesystem_iterator *)iter;
- spl_filesystem_object *object = spl_filesystem_iterator_to_object(iterator);
+ spl_filesystem_object *object = spl_filesystem_iterator_to_object(iterator TSRMLS_CC);
if (SPL_FILE_DIR_CURRENT(object, SPL_FILE_DIR_CURRENT_AS_PATHNAME)) {
if (ZVAL_IS_UNDEF(&iterator->current)) {
@@ -1762,7 +1762,7 @@ static zval *spl_filesystem_tree_it_current_data(zend_object_iterator *iter TSRM
/* {{{ spl_filesystem_tree_it_current_key */
static void spl_filesystem_tree_it_current_key(zend_object_iterator *iter, zval *key TSRMLS_DC)
{
- spl_filesystem_object *object = spl_filesystem_iterator_to_object((spl_filesystem_iterator *)iter);
+ spl_filesystem_object *object = spl_filesystem_iterator_to_object((spl_filesystem_iterator *)iter TSRMLS_CC);
if (SPL_FILE_DIR_KEY(object, SPL_FILE_DIR_KEY_AS_FILENAME)) {
ZVAL_STRING(key, object->u.dir.entry.d_name);
@@ -1777,7 +1777,7 @@ static void spl_filesystem_tree_it_current_key(zend_object_iterator *iter, zval
static void spl_filesystem_tree_it_move_forward(zend_object_iterator *iter TSRMLS_DC)
{
spl_filesystem_iterator *iterator = (spl_filesystem_iterator *)iter;
- spl_filesystem_object *object = spl_filesystem_iterator_to_object(iterator);
+ spl_filesystem_object *object = spl_filesystem_iterator_to_object(iterator TSRMLS_CC);
object->u.dir.index++;
do {
@@ -1798,7 +1798,7 @@ static void spl_filesystem_tree_it_move_forward(zend_object_iterator *iter TSRML
static void spl_filesystem_tree_it_rewind(zend_object_iterator *iter TSRMLS_DC)
{
spl_filesystem_iterator *iterator = (spl_filesystem_iterator *)iter;
- spl_filesystem_object *object = spl_filesystem_iterator_to_object(iterator);
+ spl_filesystem_object *object = spl_filesystem_iterator_to_object(iterator TSRMLS_CC);
object->u.dir.index = 0;
if (object->u.dir.dirp) {
@@ -1835,7 +1835,7 @@ zend_object_iterator *spl_filesystem_tree_get_iterator(zend_class_entry *ce, zva
zend_error(E_ERROR, "An iterator cannot be used with foreach by reference");
}
dir_object = Z_SPLFILESYSTEM_P(object);
- iterator = spl_filesystem_object_to_iterator(dir_object);
+ iterator = spl_filesystem_object_to_iterator(dir_object TSRMLS_CC);
ZVAL_COPY(&iterator->intern.data, object);
iterator->intern.funcs = &spl_filesystem_tree_it_funcs;
diff --git a/ext/spl/spl_heap.c b/ext/spl/spl_heap.c
index f627353dc2..55550d6f40 100644
--- a/ext/spl/spl_heap.c
+++ b/ext/spl/spl_heap.c
@@ -340,7 +340,7 @@ static void spl_ptr_heap_destroy(spl_ptr_heap *heap TSRMLS_DC) { /* {{{ */
int i;
for (i=0; i < heap->count; ++i) {
- heap->dtor(&heap->elements[i]);
+ heap->dtor(&heap->elements[i] TSRMLS_CC);
}
efree(heap->elements);
diff --git a/ext/spl/spl_iterators.c b/ext/spl/spl_iterators.c
index 679c480e2a..d99024273d 100644
--- a/ext/spl/spl_iterators.c
+++ b/ext/spl/spl_iterators.c
@@ -2559,7 +2559,7 @@ static inline void spl_caching_it_next(spl_dual_it_object *intern TSRMLS_DC)
ZVAL_ZVAL(&zcacheval, &intern->current.data, 1, 0);
- array_set_zval_key(HASH_OF(&intern->u.caching.zcache), key, &zcacheval);
+ array_set_zval_key(HASH_OF(&intern->u.caching.zcache), key, &zcacheval TSRMLS_CC);
zval_ptr_dtor(&zcacheval);
}
@@ -3455,7 +3455,7 @@ static int spl_iterator_to_array_apply(zend_object_iterator *iter, void *puser T
if (EG(exception)) {
return ZEND_HASH_APPLY_STOP;
}
- array_set_zval_key(Z_ARRVAL_P(return_value), &key, data);
+ array_set_zval_key(Z_ARRVAL_P(return_value), &key, data TSRMLS_CC);
zval_dtor(&key);
} else {
Z_ADDREF_P(data);
diff --git a/ext/standard/math.c b/ext/standard/math.c
index a826d48d10..7ebc928537 100644
--- a/ext/standard/math.c
+++ b/ext/standard/math.c
@@ -900,7 +900,7 @@ PHPAPI int _php_math_basetozval(zval *arg, int base, zval *ret)
* Convert a long to a string containing a base(2-36) representation of
* the number.
*/
-PHPAPI zend_string * _php_math_longtobase(zval *arg, int base)
+PHPAPI zend_string * _php_math_longtobase(zval *arg, int base TSRMLS_DC)
{
static char digits[] = "0123456789abcdefghijklmnopqrstuvwxyz";
char buf[(sizeof(unsigned long) << 3) + 1];
@@ -960,7 +960,7 @@ PHPAPI zend_string * _php_math_zvaltobase(zval *arg, int base TSRMLS_DC)
return STR_INIT(ptr, end - ptr, 0);
}
- return _php_math_longtobase(arg, base);
+ return _php_math_longtobase(arg, base TSRMLS_CC);
}
/* }}} */
@@ -1023,7 +1023,7 @@ PHP_FUNCTION(decbin)
return;
}
convert_to_long_ex(arg);
- result = _php_math_longtobase(arg, 2);
+ result = _php_math_longtobase(arg, 2 TSRMLS_CC);
RETURN_STR(result);
}
/* }}} */
@@ -1039,7 +1039,7 @@ PHP_FUNCTION(decoct)
return;
}
convert_to_long_ex(arg);
- result = _php_math_longtobase(arg, 8);
+ result = _php_math_longtobase(arg, 8 TSRMLS_CC);
RETURN_STR(result);
}
/* }}} */
@@ -1055,7 +1055,7 @@ PHP_FUNCTION(dechex)
return;
}
convert_to_long_ex(arg);
- result = _php_math_longtobase(arg, 16);
+ result = _php_math_longtobase(arg, 16 TSRMLS_CC);
RETURN_STR(result);
}
/* }}} */
diff --git a/ext/standard/php_math.h b/ext/standard/php_math.h
index 01d2152ccc..0334ac40ce 100644
--- a/ext/standard/php_math.h
+++ b/ext/standard/php_math.h
@@ -24,7 +24,7 @@
PHPAPI zend_string *_php_math_number_format(double, int, char, char);
PHPAPI zend_string *_php_math_number_format_ex(double, int, char *, size_t, char *, size_t);
-PHPAPI zend_string * _php_math_longtobase(zval *arg, int base);
+PHPAPI zend_string * _php_math_longtobase(zval *arg, int base TSRMLS_DC);
PHPAPI long _php_math_basetolong(zval *arg, int base);
PHPAPI int _php_math_basetozval(zval *arg, int base, zval *ret);
PHPAPI zend_string * _php_math_zvaltobase(zval *arg, int base TSRMLS_DC);
diff --git a/ext/standard/string.c b/ext/standard/string.c
index f671e1ebf0..463d2b2a73 100644
--- a/ext/standard/string.c
+++ b/ext/standard/string.c
@@ -2408,7 +2408,6 @@ PHP_FUNCTION(substr_replace)
while ((tmp_str = zend_hash_get_current_data_ex(Z_ARRVAL_P(str), &pos_str)) != NULL) {
zval *orig_str;
zval dummy;
- ulong refcount;
if (Z_ISREF_P(tmp_str)) {
/* see bug #55871 */
@@ -3010,7 +3009,7 @@ static void php_strtr_array_destroy_ppres(PPRES *d)
/* }}} */
/* {{{ php_strtr_array_do_repl(STR *text, PPRES *d, zval *return_value) */
-static void php_strtr_array_do_repl(STR *text, PPRES *d, zval *return_value)
+static void php_strtr_array_do_repl(STR *text, PPRES *d, zval *return_value TSRMLS_DC)
{
STRLEN pos = 0,
nextwpos = 0,
@@ -3065,7 +3064,7 @@ end_outer_loop: ;
/* }}} */
/* {{{ php_strtr_array */
-static void php_strtr_array(zval *return_value, char *str, int slen, HashTable *pats)
+static void php_strtr_array(zval *return_value, char *str, int slen, HashTable *pats TSRMLS_DC)
{
PPRES *data;
STR text;
@@ -3082,7 +3081,7 @@ static void php_strtr_array(zval *return_value, char *str, int slen, HashTable *
}
data = php_strtr_array_prepare(&text, patterns, patterns_len, 2, 2);
efree(patterns);
- php_strtr_array_do_repl(&text, data, return_value);
+ php_strtr_array_do_repl(&text, data, return_value TSRMLS_CC);
php_strtr_array_destroy_ppres(data);
zend_llist_destroy(allocs);
efree(allocs);
@@ -3113,7 +3112,7 @@ PHP_FUNCTION(strtr)
}
if (ac == 2) {
- php_strtr_array(return_value, str, str_len, HASH_OF(from));
+ php_strtr_array(return_value, str, str_len, HASH_OF(from) TSRMLS_CC);
} else {
convert_to_string_ex(from);
@@ -3794,7 +3793,7 @@ PHPAPI zend_string *php_str_to_str(char *haystack, int length, char *needle, int
/* {{{ php_str_replace_in_subject
*/
-static void php_str_replace_in_subject(zval *search, zval *replace, zval *subject, zval *result, int case_sensitivity, int *replace_count)
+static void php_str_replace_in_subject(zval *search, zval *replace, zval *subject, zval *result, int case_sensitivity, int *replace_count TSRMLS_DC)
{
zval *search_entry,
*replace_entry = NULL,
@@ -3952,7 +3951,7 @@ static void php_str_replace_common(INTERNAL_FUNCTION_PARAMETERS, int case_sensit
and add the result to the return_value array. */
while ((subject_entry = zend_hash_get_current_data(Z_ARRVAL_P(subject))) != NULL) {
if (Z_TYPE_P(subject_entry) != IS_ARRAY && Z_TYPE_P(subject_entry) != IS_OBJECT) {
- php_str_replace_in_subject(search, replace, subject_entry, &result, case_sensitivity, (argc > 3) ? &count : NULL);
+ php_str_replace_in_subject(search, replace, subject_entry, &result, case_sensitivity, (argc > 3) ? &count : NULL TSRMLS_CC);
} else {
Z_ADDREF_P(subject_entry);
COPY_PZVAL_TO_ZVAL(result, subject_entry);
@@ -3972,7 +3971,7 @@ static void php_str_replace_common(INTERNAL_FUNCTION_PARAMETERS, int case_sensit
zend_hash_move_forward(Z_ARRVAL_P(subject));
}
} else { /* if subject is not an array */
- php_str_replace_in_subject(search, replace, subject, return_value, case_sensitivity, (argc > 3) ? &count : NULL);
+ php_str_replace_in_subject(search, replace, subject, return_value, case_sensitivity, (argc > 3) ? &count : NULL TSRMLS_CC);
}
if (argc > 3) {
zval_dtor(Z_REFVAL_P(zcount));