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()");

0 commit comments

Comments
 (0)