Skip to content

Commit 6d300ba

Browse files
ZTS fixes
1 parent e77eca7 commit 6d300ba

File tree

6 files changed

+21
-21
lines changed

6 files changed

+21
-21
lines changed

Zend/zend.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -370,15 +370,15 @@ static FILE *zend_fopen_wrapper(const char *filename, char **opened_path)
370370
}
371371

372372

373-
static void register_standard_class(void)
373+
static void register_standard_class(TSRMLS_D)
374374
{
375375
zend_standard_class_def = malloc(sizeof(zend_class_entry));
376376

377377
zend_standard_class_def->type = ZEND_INTERNAL_CLASS;
378378
zend_standard_class_def->name = zend_strndup("stdClass", zend_standard_class_def->name_length);
379379
zend_standard_class_def->name_length = sizeof("stdClass") - 1;
380380
zend_standard_class_def->parent = NULL;
381-
zend_initialize_class_data(zend_standard_class_def, 1);
381+
zend_initialize_class_data(zend_standard_class_def, 1 TSRMLS_CC);
382382

383383
zend_hash_add(GLOBAL_CLASS_TABLE, "stdclass", sizeof("stdclass"), &zend_standard_class_def, sizeof(zend_class_entry *), NULL);
384384
}
@@ -560,7 +560,6 @@ int zend_startup(zend_utility_functions *utility_functions, char **extensions, i
560560
zend_hash_init_ex(GLOBAL_FUNCTION_TABLE, 100, NULL, ZEND_FUNCTION_DTOR, 1, 0);
561561
zend_hash_init_ex(GLOBAL_CLASS_TABLE, 10, NULL, ZEND_CLASS_DTOR, 1, 0);
562562

563-
register_standard_class();
564563
zend_hash_init_ex(&module_registry, 50, NULL, ZEND_MODULE_DTOR, 1, 0);
565564
zend_init_rsrc_list_dtors();
566565

@@ -597,6 +596,7 @@ int zend_startup(zend_utility_functions *utility_functions, char **extensions, i
597596
EG(user_error_handler) = NULL;
598597
EG(user_exception_handler) = NULL;
599598
#endif
599+
register_standard_class(TSRMLS_C);
600600
zend_register_standard_constants(TSRMLS_C);
601601

602602
#ifndef ZTS

Zend/zend_API.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1360,7 +1360,7 @@ ZEND_API zend_class_entry *zend_register_internal_class(zend_class_entry *orig_c
13601360

13611361
class_entry->type = ZEND_INTERNAL_CLASS;
13621362
class_entry->parent = NULL;
1363-
zend_initialize_class_data(class_entry, 0);
1363+
zend_initialize_class_data(class_entry, 0 TSRMLS_CC);
13641364

13651365
if (class_entry->builtin_functions) {
13661366
zend_register_functions(class_entry, class_entry->builtin_functions, &class_entry->function_table, MODULE_PERSISTENT TSRMLS_CC);

Zend/zend_compile.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1663,7 +1663,7 @@ void zend_do_inheritance(zend_class_entry *ce, zend_class_entry *parent_ce)
16631663
do_inherit_parent_constructor(ce);
16641664
}
16651665

1666-
static void create_class(HashTable *class_table, char *name, int name_length, zend_class_entry **ce)
1666+
static void create_class(HashTable *class_table, char *name, int name_length, zend_class_entry **ce TSRMLS_DC)
16671667
{
16681668
zend_class_entry *new_class_entry;
16691669

@@ -1674,7 +1674,7 @@ static void create_class(HashTable *class_table, char *name, int name_length, ze
16741674
new_class_entry->name = estrndup(name, name_length);
16751675
new_class_entry->name_length = name_length;
16761676
new_class_entry->parent = NULL;
1677-
zend_initialize_class_data(new_class_entry, 1);
1677+
zend_initialize_class_data(new_class_entry, 1 TSRMLS_CC);
16781678

16791679
zend_str_tolower(new_class_entry->name, new_class_entry->name_length);
16801680

@@ -1686,7 +1686,7 @@ static void create_class(HashTable *class_table, char *name, int name_length, ze
16861686

16871687
#include "../TSRM/tsrm_strtok_r.h"
16881688

1689-
static int create_nested_class(HashTable *class_table, char *path, zend_class_entry *new_ce)
1689+
static int create_nested_class(HashTable *class_table, char *path, zend_class_entry *new_ce TSRMLS_DC)
16901690
{
16911691
char *cur, *temp;
16921692
char *last;
@@ -1696,7 +1696,7 @@ static int create_nested_class(HashTable *class_table, char *path, zend_class_en
16961696
cur = tsrm_strtok_r(path, ":", &temp);
16971697

16981698
if (zend_hash_find(class_table, cur, strlen(cur)+1, (void **)&pce) == FAILURE) {
1699-
create_class(class_table, cur, strlen(cur), &ce);
1699+
create_class(class_table, cur, strlen(cur), &ce TSRMLS_CC);
17001700
} else {
17011701
ce = *pce;
17021702
}
@@ -1709,7 +1709,7 @@ static int create_nested_class(HashTable *class_table, char *path, zend_class_en
17091709
break;
17101710
}
17111711
if (zend_hash_find(&ce->class_table, last, strlen(last)+1, (void **)&pce) == FAILURE) {
1712-
create_class(&ce->class_table, last, strlen(last), &ce);
1712+
create_class(&ce->class_table, last, strlen(last), &ce TSRMLS_CC);
17131713
} else {
17141714
ce = *pce;
17151715
}
@@ -1756,7 +1756,7 @@ ZEND_API int do_bind_function(zend_op *opline, HashTable *function_table, HashTa
17561756
}
17571757

17581758

1759-
ZEND_API int do_bind_class(zend_op *opline, HashTable *function_table, HashTable *class_table)
1759+
ZEND_API int do_bind_class(zend_op *opline, HashTable *function_table, HashTable *class_table TSRMLS_DC)
17601760
{
17611761
zend_class_entry *ce, **pce;
17621762

@@ -1767,7 +1767,7 @@ ZEND_API int do_bind_class(zend_op *opline, HashTable *function_table, HashTable
17671767
ce = *pce;
17681768
}
17691769
if (strchr(opline->op2.u.constant.value.str.val, ':')) {
1770-
return create_nested_class(class_table, opline->op2.u.constant.value.str.val, ce);
1770+
return create_nested_class(class_table, opline->op2.u.constant.value.str.val, ce TSRMLS_CC);
17711771
}
17721772
ce->refcount++;
17731773
if (zend_hash_add(class_table, opline->op2.u.constant.value.str.val, opline->op2.u.constant.value.str.len+1, &ce, sizeof(zend_class_entry *), NULL)==FAILURE) {
@@ -1779,7 +1779,7 @@ ZEND_API int do_bind_class(zend_op *opline, HashTable *function_table, HashTable
17791779
}
17801780
}
17811781

1782-
ZEND_API int do_bind_inherited_class(zend_op *opline, HashTable *function_table, HashTable *class_table, zend_class_entry *parent_ce)
1782+
ZEND_API int do_bind_inherited_class(zend_op *opline, HashTable *function_table, HashTable *class_table, zend_class_entry *parent_ce TSRMLS_DC)
17831783
{
17841784
zend_class_entry *ce, **pce;
17851785
int found_ce;
@@ -1796,7 +1796,7 @@ ZEND_API int do_bind_inherited_class(zend_op *opline, HashTable *function_table,
17961796
zend_do_inheritance(ce, parent_ce);
17971797

17981798
if (strchr(opline->op2.u.constant.value.str.val, ':')) {
1799-
return create_nested_class(class_table, opline->op2.u.constant.value.str.val, ce);
1799+
return create_nested_class(class_table, opline->op2.u.constant.value.str.val, ce TSRMLS_CC);
18001800
}
18011801

18021802
ce->refcount++;
@@ -2136,7 +2136,7 @@ void zend_do_begin_class_declaration(znode *class_token, znode *class_name, znod
21362136

21372137
new_class_entry->type = ZEND_USER_CLASS;
21382138
new_class_entry->parent = NULL;
2139-
zend_initialize_class_data(new_class_entry, 1);
2139+
zend_initialize_class_data(new_class_entry, 1 TSRMLS_CC);
21402140

21412141
if (parent_class_name->op_type != IS_UNUSED) {
21422142
doing_inheritance = 1;
@@ -3289,7 +3289,7 @@ void zend_do_declare_namespace_constant(znode *var_name, znode *value TSRMLS_DC)
32893289
FREE_PNODE(var_name);
32903290
}
32913291

3292-
void zend_initialize_class_data(zend_class_entry *ce, zend_bool nullify_handlers)
3292+
void zend_initialize_class_data(zend_class_entry *ce, zend_bool nullify_handlers TSRMLS_DC)
32933293
{
32943294
zend_bool persistent_hashes = (ce->type == ZEND_INTERNAL_CLASS) ? 1 : 0;
32953295

Zend/zend_compile.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -336,8 +336,8 @@ void zend_do_end_catch(znode *try_token TSRMLS_DC);
336336
void zend_do_throw(znode *expr TSRMLS_DC);
337337

338338
ZEND_API int do_bind_function(zend_op *opline, HashTable *function_table, HashTable *class_table, int compile_time);
339-
ZEND_API int do_bind_class(zend_op *opline, HashTable *function_table, HashTable *class_table);
340-
ZEND_API int do_bind_inherited_class(zend_op *opline, HashTable *function_table, HashTable *class_table, zend_class_entry *parent_ce);
339+
ZEND_API int do_bind_class(zend_op *opline, HashTable *function_table, HashTable *class_table TSRMLS_DC);
340+
ZEND_API int do_bind_inherited_class(zend_op *opline, HashTable *function_table, HashTable *class_table, zend_class_entry *parent_ce TSRMLS_DC);
341341

342342
void zend_do_inheritance(zend_class_entry *ce, zend_class_entry *parent_ce);
343343
void zend_do_early_binding(TSRMLS_D);
@@ -470,7 +470,7 @@ int pass_two(zend_op_array *op_array TSRMLS_DC);
470470
zend_brk_cont_element *get_next_brk_cont_element(zend_op_array *op_array);
471471
ZEND_API zend_bool zend_is_compiling(TSRMLS_D);
472472
ZEND_API char *zend_make_compiled_string_description(char *name TSRMLS_DC);
473-
void zend_initialize_class_data(zend_class_entry *ce, zend_bool nullify_handlers);
473+
void zend_initialize_class_data(zend_class_entry *ce, zend_bool nullify_handlers TSRMLS_DC);
474474

475475

476476
int zend_register_auto_global(char *name, uint name_len TSRMLS_DC);

Zend/zend_execute.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3868,14 +3868,14 @@ int zend_ext_fcall_end_handler(ZEND_OPCODE_HANDLER_ARGS)
38683868

38693869
int zend_declare_class_handler(ZEND_OPCODE_HANDLER_ARGS)
38703870
{
3871-
do_bind_class(EX(opline), EG(function_table), EG(class_table));
3871+
do_bind_class(EX(opline), EG(function_table), EG(class_table) TSRMLS_CC);
38723872
NEXT_OPCODE();
38733873
}
38743874

38753875

38763876
int zend_declare_inherited_class_handler(ZEND_OPCODE_HANDLER_ARGS)
38773877
{
3878-
do_bind_inherited_class(EX(opline), EG(function_table), EG(class_table), EX_T(EX(opline)->extended_value).EA.class_entry);
3878+
do_bind_inherited_class(EX(opline), EG(function_table), EG(class_table), EX_T(EX(opline)->extended_value).EA.class_entry TSRMLS_CC);
38793879
NEXT_OPCODE();
38803880
}
38813881

Zend/zend_execute_API.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ void shutdown_executor(TSRMLS_D)
194194
{
195195
/* return to global namespace here */
196196
if(EG(active_namespace) != EG(global_namespace_ptr)) {
197-
zend_switch_namespace(EG(global_namespace_ptr));
197+
zend_switch_namespace(EG(global_namespace_ptr) TSRMLS_CC);
198198
}
199199

200200
zend_try {

0 commit comments

Comments
 (0)