Skip to content

Commit 302933d

Browse files
committed
Remove no_separation flag
1 parent e93aca7 commit 302933d

File tree

27 files changed

+10
-50
lines changed

27 files changed

+10
-50
lines changed

UPGRADING.INTERNALS

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ PHP 8.0 INTERNALS UPGRADE NOTES
1919
p. ARG_COUNT() macro removed
2020
q. GC_COLLECTABLE flag
2121
r. Cannot implement Traversable only
22+
s. zend_fcall_info no_separation flag removed
2223

2324
2. Build system changes
2425
a. Abstract
@@ -135,6 +136,11 @@ PHP 8.0 INTERNALS UPGRADE NOTES
135136
zend_create_internal_iterator_zval(return_value, ZEND_THIS);
136137
}
137138

139+
s. The zend_fcall_info no_separation flag has been removed, and separation is
140+
never allowed. If you wish to pass (or allow passing) arguments by
141+
reference, explicitly create those arguments as references using
142+
ZEND_MAKE_REF.
143+
138144
========================
139145
2. Build system changes
140146
========================

Zend/zend_API.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3342,7 +3342,6 @@ ZEND_API int zend_fcall_info_init(zval *callable, uint32_t check_flags, zend_fca
33423342
fci->retval = NULL;
33433343
fci->param_count = 0;
33443344
fci->params = NULL;
3345-
fci->no_separation = 1;
33463345

33473346
return SUCCESS;
33483347
}

Zend/zend_API.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ typedef struct _zend_fcall_info {
4646
zval *retval;
4747
zval *params;
4848
zend_object *object;
49-
zend_bool no_separation;
5049
uint32_t param_count;
5150
} zend_fcall_info;
5251

@@ -498,12 +497,10 @@ ZEND_API int add_property_zval_ex(zval *arg, const char *key, size_t key_len, zv
498497
#define add_property_zval(__arg, __key, __value) add_property_zval_ex(__arg, __key, strlen(__key), __value)
499498

500499

501-
ZEND_API int _call_user_function_ex(zval *object, zval *function_name, zval *retval_ptr, uint32_t param_count, zval params[], int no_separation);
500+
ZEND_API int _call_user_function_ex(zval *object, zval *function_name, zval *retval_ptr, uint32_t param_count, zval params[]);
502501

503502
#define call_user_function(_unused, object, function_name, retval_ptr, param_count, params) \
504-
_call_user_function_ex(object, function_name, retval_ptr, param_count, params, 1)
505-
#define call_user_function_ex(_unused, object, function_name, retval_ptr, param_count, params, no_separation, _unused2) \
506-
_call_user_function_ex(object, function_name, retval_ptr, param_count, params, no_separation)
503+
_call_user_function_ex(object, function_name, retval_ptr, param_count, params)
507504

508505
ZEND_API extern const zend_fcall_info empty_fcall_info;
509506
ZEND_API extern const zend_fcall_info_cache empty_fcall_info_cache;

Zend/zend_closures.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,6 @@ ZEND_METHOD(Closure, call)
167167
fci.size = sizeof(fci);
168168
ZVAL_OBJ(&fci.function_name, &closure->std);
169169
fci.retval = &closure_result;
170-
fci.no_separation = 1;
171170

172171
if (zend_call_function(&fci, &fci_cache) == SUCCESS && Z_TYPE(closure_result) != IS_UNDEF) {
173172
if (Z_ISREF(closure_result)) {

Zend/zend_exceptions.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -659,7 +659,6 @@ ZEND_METHOD(Exception, __toString)
659659
fci.retval = &trace;
660660
fci.param_count = 0;
661661
fci.params = NULL;
662-
fci.no_separation = 1;
663662

664663
zend_call_function(&fci, NULL);
665664

Zend/zend_execute_API.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,7 @@ ZEND_API int zval_update_constant(zval *pp) /* {{{ */
619619
}
620620
/* }}} */
621621

622-
int _call_user_function_ex(zval *object, zval *function_name, zval *retval_ptr, uint32_t param_count, zval params[], int no_separation) /* {{{ */
622+
int _call_user_function_ex(zval *object, zval *function_name, zval *retval_ptr, uint32_t param_count, zval params[]) /* {{{ */
623623
{
624624
zend_fcall_info fci;
625625

@@ -629,7 +629,6 @@ int _call_user_function_ex(zval *object, zval *function_name, zval *retval_ptr,
629629
fci.retval = retval_ptr;
630630
fci.param_count = param_count;
631631
fci.params = params;
632-
fci.no_separation = (zend_bool) no_separation;
633632

634633
return zend_call_function(&fci, NULL);
635634
}
@@ -737,10 +736,7 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache) /
737736

738737
if (ARG_SHOULD_BE_SENT_BY_REF(func, i + 1)) {
739738
if (UNEXPECTED(!Z_ISREF_P(arg))) {
740-
if (!fci->no_separation) {
741-
/* Separation is enabled -- create a ref */
742-
ZVAL_NEW_REF(arg, arg);
743-
} else if (!ARG_MAY_BE_SENT_BY_REF(func, i + 1)) {
739+
if (!ARG_MAY_BE_SENT_BY_REF(func, i + 1)) {
744740
/* By-value send is not allowed -- emit a warning,
745741
* but still perform the call with a by-value send. */
746742
zend_param_must_be_ref(func, i + 1);
@@ -866,7 +862,6 @@ ZEND_API void zend_call_known_function(
866862
fci.retval = retval_ptr ? retval_ptr : &retval;
867863
fci.param_count = param_count;
868864
fci.params = params;
869-
fci.no_separation = 1;
870865
ZVAL_UNDEF(&fci.function_name); /* Unused */
871866

872867
fcic.function_handler = fn;

ext/curl/interface.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1385,7 +1385,6 @@ static size_t curl_write(char *data, size_t size, size_t nmemb, void *ctx)
13851385
fci.retval = &retval;
13861386
fci.param_count = 2;
13871387
fci.params = argv;
1388-
fci.no_separation = 1;
13891388

13901389
ch->in_callback = 1;
13911390
error = zend_call_function(&fci, &t->fci_cache);
@@ -1432,7 +1431,6 @@ static int curl_fnmatch(void *ctx, const char *pattern, const char *string)
14321431
fci.retval = &retval;
14331432
fci.param_count = 3;
14341433
fci.params = argv;
1435-
fci.no_separation = 1;
14361434

14371435
ch->in_callback = 1;
14381436
error = zend_call_function(&fci, &t->fci_cache);
@@ -1485,7 +1483,6 @@ static size_t curl_progress(void *clientp, double dltotal, double dlnow, double
14851483
fci.retval = &retval;
14861484
fci.param_count = 5;
14871485
fci.params = argv;
1488-
fci.no_separation = 1;
14891486

14901487
ch->in_callback = 1;
14911488
error = zend_call_function(&fci, &t->fci_cache);
@@ -1541,7 +1538,6 @@ static size_t curl_read(char *data, size_t size, size_t nmemb, void *ctx)
15411538
fci.retval = &retval;
15421539
fci.param_count = 3;
15431540
fci.params = argv;
1544-
fci.no_separation = 1;
15451541

15461542
ch->in_callback = 1;
15471543
error = zend_call_function(&fci, &t->fci_cache);
@@ -1603,7 +1599,6 @@ static size_t curl_write_header(char *data, size_t size, size_t nmemb, void *ctx
16031599
fci.retval = &retval;
16041600
fci.param_count = 2;
16051601
fci.params = argv;
1606-
fci.no_separation = 1;
16071602

16081603
ch->in_callback = 1;
16091604
error = zend_call_function(&fci, &t->fci_cache);

ext/dom/xpath.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,6 @@ static void dom_xpath_ext_function_php(xmlXPathParserContextPtr ctxt, int nargs,
151151

152152
fci.object = NULL;
153153
fci.retval = &retval;
154-
fci.no_separation = 1;
155154

156155
if (!zend_make_callable(&fci.function_name, &callable)) {
157156
php_error_docref(NULL, E_WARNING, "Unable to call handler %s()", ZSTR_VAL(callable));

ext/ffi/ffi.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -857,7 +857,6 @@ static void zend_ffi_callback_trampoline(ffi_cif* cif, void* ret, void** args, v
857857
fci.retval = &retval;
858858
fci.params = do_alloca(sizeof(zval) *callback_data->arg_count, use_heap);
859859
fci.object = NULL;
860-
fci.no_separation = 1;
861860
fci.param_count = callback_data->arg_count;
862861

863862
if (callback_data->type->func.args) {

ext/intl/converter/converter.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,6 @@ static void php_converter_to_u_callback(const void *context,
229229
objval->to_cb.param_count = 4;
230230
objval->to_cb.params = zargs;
231231
objval->to_cb.retval = &retval;
232-
objval->to_cb.no_separation = 1;
233232
if (zend_call_function(&(objval->to_cb), &(objval->to_cache)) == FAILURE) {
234233
/* Unlikely */
235234
php_converter_throw_failure(objval, U_INTERNAL_PROGRAM_ERROR, "Unexpected failure calling toUCallback()");
@@ -312,7 +311,6 @@ static void php_converter_from_u_callback(const void *context,
312311
objval->from_cb.param_count = 4;
313312
objval->from_cb.params = zargs;
314313
objval->from_cb.retval = &retval;
315-
objval->from_cb.no_separation = 1;
316314
if (zend_call_function(&(objval->from_cb), &(objval->from_cache)) == FAILURE) {
317315
/* Unlikely */
318316
php_converter_throw_failure(objval, U_INTERNAL_PROGRAM_ERROR, "Unexpected failure calling fromUCallback()");

ext/libxml/libxml.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,6 @@ static xmlParserInputPtr _php_libxml_external_entity_loader(const char *URL,
566566
fci->retval = &retval;
567567
fci->params = params;
568568
fci->param_count = sizeof(params)/sizeof(*params);
569-
fci->no_separation = 1;
570569

571570
status = zend_call_function(fci, &LIBXML(entity_loader).fcc);
572571
if (status != SUCCESS || Z_ISUNDEF(retval)) {

ext/mysqli/mysqli.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1227,7 +1227,6 @@ void php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAMETERS, int override_flags
12271227
fci.retval = &retval;
12281228
fci.params = NULL;
12291229
fci.param_count = 0;
1230-
fci.no_separation = 1;
12311230

12321231
if (ctor_params && Z_TYPE_P(ctor_params) != IS_NULL) {
12331232
if (zend_fcall_info_args(&fci, ctor_params) == FAILURE) {

ext/pcre/php_pcre.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1529,7 +1529,6 @@ static zend_string *preg_do_repl_func(zend_fcall_info *fci, zend_fcall_info_cach
15291529
fci->retval = &retval;
15301530
fci->param_count = 1;
15311531
fci->params = &arg;
1532-
fci->no_separation = 1;
15331532

15341533
if (zend_call_function(fci, fcc) == SUCCESS && Z_TYPE(retval) != IS_UNDEF) {
15351534
if (EXPECTED(Z_TYPE(retval) == IS_STRING)) {

ext/pdo/pdo_dbh.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,6 @@ static void pdo_stmt_construct(zend_execute_data *execute_data, pdo_stmt_t *stmt
437437
fci.retval = &retval;
438438
fci.param_count = 0;
439439
fci.params = NULL;
440-
fci.no_separation = 1;
441440

442441
zend_fcall_info_args(&fci, ctor_args);
443442

ext/pdo/pdo_stmt.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,6 @@ static int do_fetch_class_prepare(pdo_stmt_t *stmt) /* {{{ */
655655
fci->retval = &stmt->fetch.cls.retval;
656656
fci->param_count = 0;
657657
fci->params = NULL;
658-
fci->no_separation = 1;
659658

660659
zend_fcall_info_args_ex(fci, ce->constructor, &stmt->fetch.cls.ctor_args);
661660

ext/pgsql/pgsql.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2584,7 +2584,6 @@ static void php_pgsql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, zend_long result_
25842584
fci.retval = &retval;
25852585
fci.params = NULL;
25862586
fci.param_count = 0;
2587-
fci.no_separation = 1;
25882587

25892588
if (ctor_params && Z_TYPE_P(ctor_params) != IS_NULL) {
25902589
if (zend_fcall_info_args(&fci, ctor_params) == FAILURE) {

ext/reflection/php_reflection.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1816,7 +1816,6 @@ ZEND_METHOD(ReflectionFunction, invoke)
18161816
fci.retval = &retval;
18171817
fci.param_count = num_args;
18181818
fci.params = params;
1819-
fci.no_separation = 1;
18201819

18211820
fcc.function_handler = fptr;
18221821
fcc.called_scope = NULL;
@@ -1878,7 +1877,6 @@ ZEND_METHOD(ReflectionFunction, invokeArgs)
18781877
fci.retval = &retval;
18791878
fci.param_count = argc;
18801879
fci.params = params;
1881-
fci.no_separation = 1;
18821880

18831881
fcc.function_handler = fptr;
18841882
fcc.called_scope = NULL;
@@ -3206,7 +3204,6 @@ static void reflection_method_invoke(INTERNAL_FUNCTION_PARAMETERS, int variadic)
32063204
fci.retval = &retval;
32073205
fci.param_count = argc;
32083206
fci.params = params;
3209-
fci.no_separation = 1;
32103207

32113208
fcc.function_handler = mptr;
32123209
fcc.called_scope = intern->ce;

ext/soap/soap.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -654,7 +654,6 @@ PHP_METHOD(SoapFault, __toString)
654654
fci.retval = &trace;
655655
fci.param_count = 0;
656656
fci.params = NULL;
657-
fci.no_separation = 1;
658657

659658
zend_call_function(&fci, NULL);
660659

ext/spl/spl_directory.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1904,7 +1904,6 @@ static int spl_filesystem_file_call(spl_filesystem_object *intern, zend_function
19041904
fci.retval = return_value;
19051905
fci.param_count = num_args;
19061906
fci.params = params;
1907-
fci.no_separation = 1;
19081907
ZVAL_STR(&fci.function_name, func_ptr->common.function_name);
19091908

19101909
fcic.function_handler = func_ptr;

ext/spl/spl_engine.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ static inline void spl_instantiate_arg_n(zend_class_entry *pce, zval *retval, in
6363
fci.retval = &dummy;
6464
fci.param_count = argc;
6565
fci.params = argv;
66-
fci.no_separation = 1;
6766

6867
fcc.function_handler = func;
6968
fcc.called_scope = pce;

ext/spl/spl_iterators.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1785,7 +1785,6 @@ PHP_METHOD(CallbackFilterIterator, accept)
17851785
fci->retval = return_value;
17861786
fci->param_count = 3;
17871787
fci->params = params;
1788-
fci->no_separation = 1;
17891788

17901789
if (zend_call_function(fci, fcc) != SUCCESS || Z_ISUNDEF_P(return_value)) {
17911790
RETURN_FALSE;

ext/sqlite3/sqlite3.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2146,7 +2146,6 @@ static int php_sqlite3_authorizer(void *autharg, int action, const char *arg1, c
21462146
fci->retval = &retval;
21472147
fci->param_count = 5;
21482148
fci->params = argv;
2149-
fci->no_separation = 1;
21502149

21512150
int authreturn = SQLITE_DENY;
21522151

ext/standard/array.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -921,7 +921,6 @@ static inline int php_array_user_compare_unstable(Bucket *f, Bucket *s) /* {{{ *
921921
BG(user_compare_fci).param_count = 2;
922922
BG(user_compare_fci).params = args;
923923
BG(user_compare_fci).retval = &retval;
924-
BG(user_compare_fci).no_separation = 1;
925924
call_failed = zend_call_function(&BG(user_compare_fci), &BG(user_compare_fci_cache)) == FAILURE || Z_TYPE(retval) == IS_UNDEF;
926925
zval_ptr_dtor(&args[1]);
927926
zval_ptr_dtor(&args[0]);
@@ -1063,7 +1062,6 @@ static inline int php_array_user_key_compare_unstable(Bucket *f, Bucket *s) /* {
10631062
BG(user_compare_fci).param_count = 2;
10641063
BG(user_compare_fci).params = args;
10651064
BG(user_compare_fci).retval = &retval;
1066-
BG(user_compare_fci).no_separation = 1;
10671065
call_failed = zend_call_function(&BG(user_compare_fci), &BG(user_compare_fci_cache)) == FAILURE || Z_TYPE(retval) == IS_UNDEF;
10681066
zval_ptr_dtor(&args[1]);
10691067
zval_ptr_dtor(&args[0]);
@@ -1374,7 +1372,6 @@ static int php_array_walk(zval *array, zval *userdata, int recursive) /* {{{ */
13741372
BG(array_walk_fci).retval = &retval;
13751373
BG(array_walk_fci).param_count = userdata ? 3 : 2;
13761374
BG(array_walk_fci).params = args;
1377-
BG(array_walk_fci).no_separation = 1;
13781375

13791376
zend_hash_internal_pointer_reset_ex(target_hash, &pos);
13801377
ht_iter = zend_hash_iterator_add(target_hash, pos);
@@ -4546,7 +4543,6 @@ static int zval_user_compare(zval *a, zval *b) /* {{{ */
45464543
BG(user_compare_fci).param_count = 2;
45474544
BG(user_compare_fci).params = args;
45484545
BG(user_compare_fci).retval = &retval;
4549-
BG(user_compare_fci).no_separation = 1;
45504546

45514547
if (zend_call_function(&BG(user_compare_fci), &BG(user_compare_fci_cache)) == SUCCESS && Z_TYPE(retval) != IS_UNDEF) {
45524548
zend_long ret = zval_get_long(&retval);
@@ -5906,7 +5902,6 @@ PHP_FUNCTION(array_reduce)
59065902

59075903
fci.retval = &retval;
59085904
fci.param_count = 2;
5909-
fci.no_separation = 1;
59105905

59115906
ZEND_HASH_FOREACH_VAL(htbl, operand) {
59125907
ZVAL_COPY_VALUE(&args[0], return_value);
@@ -5959,7 +5954,6 @@ PHP_FUNCTION(array_filter)
59595954

59605955
if (ZEND_FCI_INITIALIZED(fci)) {
59615956
have_callback = 1;
5962-
fci.no_separation = 1;
59635957
fci.retval = &retval;
59645958
if (use_type == ARRAY_FILTER_USE_BOTH) {
59655959
fci.param_count = 2;
@@ -6062,7 +6056,6 @@ PHP_FUNCTION(array_map)
60626056
fci.retval = &result;
60636057
fci.param_count = 1;
60646058
fci.params = &arg;
6065-
fci.no_separation = 1;
60666059

60676060
ZVAL_COPY(&arg, zv);
60686061
ret = zend_call_function(&fci, &fci_cache);
@@ -6151,7 +6144,6 @@ PHP_FUNCTION(array_map)
61516144
fci.retval = &result;
61526145
fci.param_count = n_arrays;
61536146
fci.params = params;
6154-
fci.no_separation = 1;
61556147

61566148
if (zend_call_function(&fci, &fci_cache) != SUCCESS || Z_TYPE(result) == IS_UNDEF) {
61576149
efree(array_pos);

ext/xml/xml.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,6 @@ static void xml_call_handler(xml_parser *parser, zval *handler, zend_function *f
464464
fci.retval = retval;
465465
fci.param_count = argc;
466466
fci.params = argv;
467-
fci.no_separation = 1;
468467

469468
result = zend_call_function(&fci, NULL);
470469
if (result == FAILURE) {

ext/xsl/xsltprocessor.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,6 @@ static void xsl_ext_function_php(xmlXPathParserContextPtr ctxt, int nargs, int t
245245
ZVAL_COPY_VALUE(&fci.function_name, &handler);
246246
fci.object = NULL;
247247
fci.retval = &retval;
248-
fci.no_separation = 1;
249248
if (!zend_make_callable(&handler, &callable)) {
250249
if (!EG(exception)) {
251250
php_error_docref(NULL, E_WARNING, "Unable to call handler %s()", ZSTR_VAL(callable));

main/streams/userspace.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,6 @@ static void user_stream_create_object(struct php_user_stream_wrapper *uwrap, php
308308
fci.retval = &retval;
309309
fci.param_count = 0;
310310
fci.params = NULL;
311-
fci.no_separation = 1;
312311

313312
fcc.function_handler = uwrap->ce->constructor;
314313
fcc.called_scope = Z_OBJCE_P(object);

sapi/phpdbg/phpdbg_prompt.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ static inline int phpdbg_call_register(phpdbg_param_t *stack) /* {{{ */
122122
//???fci.symbol_table = zend_rebuild_symbol_table();
123123
fci.object = NULL;
124124
fci.retval = &fretval;
125-
fci.no_separation = 1;
126125

127126
if (name->next) {
128127
zval params;

0 commit comments

Comments
 (0)