1
0
mirror of https://github.com/php/php-src.git synced 2026-04-09 00:53:30 +02:00

Add clarifying comment for SEND_VAL usage

This confused me for a bit, because we're using SEND_VAL here to
potentially perform a by-ref SEND, while it is usually used for
by-val SENDs.
This commit is contained in:
Nikita Popov
2022-04-24 18:20:46 +02:00
parent 7f34afc32b
commit 460bbc8ebe

View File

@@ -3487,6 +3487,9 @@ static uint32_t zend_compile_args(
if (ARG_MUST_BE_SENT_BY_REF(fbc, arg_num)) {
opcode = ZEND_SEND_VAR_NO_REF;
} else if (ARG_MAY_BE_SENT_BY_REF(fbc, arg_num)) {
/* For IS_VAR operands, SEND_VAL will pass through the operand without
* dereferencing, so it will use a by-ref pass if the call returned by-ref
* and a by-value pass if it returned by-value. */
opcode = ZEND_SEND_VAL;
} else {
opcode = ZEND_SEND_VAR;