Commit cb0a38a1e5a for php

commit cb0a38a1e5ac48dce2f5d15586fd40809207de12
Merge: 4fc0c741029 682ee233e5d
Author: ndossche <7771979+ndossche@users.noreply.github.com>
Date:   Tue Nov 24 20:30:50 2026 +0100

    Merge branch 'PHP-8.5' into PHP-8.6

    * PHP-8.5:
      Fix GH-25313: Assertion !EG(exception) in ZEND_FE_FREE when unpacking a generator into a by-ref parameter throws

diff --cc Zend/zend_vm_def.h
index d10c891a730,74d3a33f6cf..e8d4747d868
--- a/Zend/zend_vm_def.h
+++ b/Zend/zend_vm_def.h
@@@ -5459,14 -5422,18 +5459,18 @@@ ZEND_VM_C_LABEL(send_again)
  					Z_TRY_ADDREF_P(arg);

  					if (ARG_MUST_BE_SENT_BY_REF(EX(call)->func, arg_num)) {
+ 						ZVAL_NEW_REF(top, arg);
  						zend_error(
 -							E_WARNING, "Cannot pass by-reference argument %d of %s%s%s()"
 +							E_WARNING, "Cannot pass by-reference argument %d of %pS%s%pS()"
  							" by unpacking a Traversable, passing by-value instead", arg_num,
 -							EX(call)->func->common.scope ? ZSTR_VAL(EX(call)->func->common.scope->name) : "",
 +							EX(call)->func->common.scope ? EX(call)->func->common.scope->name : ZSTR_EMPTY_ALLOC(),
  							EX(call)->func->common.scope ? "::" : "",
 -							ZSTR_VAL(EX(call)->func->common.function_name)
 +							EX(call)->func->common.function_name
  						);
- 						ZVAL_NEW_REF(top, arg);
+ 						if (UNEXPECTED(EG(exception) != NULL)) {
+ 							zend_string_release(name);
+ 							break;
+ 						}
  					} else {
  						ZVAL_COPY_VALUE(top, arg);
  					}
@@@ -5483,16 -5450,20 +5487,20 @@@
  					top = ZEND_CALL_ARG(EX(call), arg_num);
  					ZVAL_DEREF(arg);
  					Z_TRY_ADDREF_P(arg);
+ 					ZEND_CALL_NUM_ARGS(EX(call))++;

  					if (ARG_MUST_BE_SENT_BY_REF(EX(call)->func, arg_num)) {
+ 						ZVAL_NEW_REF(top, arg);
  						zend_error(
 -							E_WARNING, "Cannot pass by-reference argument %d of %s%s%s()"
 +							E_WARNING, "Cannot pass by-reference argument %d of %pS%s%pS()"
  							" by unpacking a Traversable, passing by-value instead", arg_num,
 -							EX(call)->func->common.scope ? ZSTR_VAL(EX(call)->func->common.scope->name) : "",
 +							EX(call)->func->common.scope ? EX(call)->func->common.scope->name : ZSTR_EMPTY_ALLOC(),
  							EX(call)->func->common.scope ? "::" : "",
 -							ZSTR_VAL(EX(call)->func->common.function_name)
 +							EX(call)->func->common.function_name
  						);
- 						ZVAL_NEW_REF(top, arg);
+ 						if (UNEXPECTED(EG(exception) != NULL)) {
+ 							break;
+ 						}
  					} else {
  						ZVAL_COPY_VALUE(top, arg);
  					}
diff --cc Zend/zend_vm_execute.h
index 8679330b2d0,cb4520d8565..b1f4629a47b
Binary files differ