Skip to content

Commit 7c351ba

Browse files
c9snikic
authored andcommitted
Fix out-dated docs and typo
[ci skip]
1 parent 51dacaf commit 7c351ba

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

Zend/zend_compile.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -958,7 +958,7 @@ static zend_always_inline int zend_check_arg_send_type(const zend_function *zf,
958958
#define ARG_MAY_BE_SENT_BY_REF(zf, arg_num) \
959959
zend_check_arg_send_type(zf, arg_num, ZEND_SEND_PREFER_REF)
960960

961-
/* Quick API to check firat 12 arguments */
961+
/* Quick API to check first 12 arguments */
962962
#define MAX_ARG_FLAG_NUM 12
963963

964964
#ifdef WORDS_BIGENDIAN

Zend/zend_execute.c

+10-1
Original file line numberDiff line numberDiff line change
@@ -3261,7 +3261,7 @@ ZEND_API void zend_free_compiled_variables(zend_execute_data *execute_data) /* {
32613261
* +========================================+
32623262
* EG(current_execute_data) -> | zend_execute_data |
32633263
* +----------------------------------------+
3264-
* EX_CV_NUM(0) ---------> | VAR[0] = ARG[1] |
3264+
* EX_VAR_NUM(0) --------> | VAR[0] = ARG[1] |
32653265
* | ... |
32663266
* | VAR[op_array->num_args-1] = ARG[N] |
32673267
* | ... |
@@ -3274,6 +3274,15 @@ ZEND_API void zend_free_compiled_variables(zend_execute_data *execute_data) /* {
32743274
* +----------------------------------------+
32753275
*/
32763276

3277+
/* zend_copy_extra_args is used when the actually passed number of arguments
3278+
* (EX_NUM_ARGS) is greater than what the function defined (op_array->num_args).
3279+
*
3280+
* The extra arguments will be copied into the call frame after all the compiled variables.
3281+
*
3282+
* If there are extra arguments copied, a flag "ZEND_CALL_FREE_EXTRA_ARGS" will be set
3283+
* on the zend_execute_data, and when the executor leaves the function, the
3284+
* args will be freed in zend_leave_helper.
3285+
*/
32773286
static zend_never_inline void zend_copy_extra_args(EXECUTE_DATA_D)
32783287
{
32793288
zend_op_array *op_array = &EX(func)->op_array;

0 commit comments

Comments
 (0)