mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
Fix borked SCCP of array containing partial object
In SCCP, arrays containing partial objects must be marked as partial so that their values are not accidentally propagated. Fixes GH-21227 Closes GH-21232
This commit is contained in:
@@ -965,7 +965,7 @@ static void sccp_visit_instr(scdf_ctx *scdf, zend_op *opline, zend_ssa_op *ssa_o
|
||||
SET_RESULT(op1, &zv);
|
||||
} else if (ct_eval_assign_dim(&zv, data, op2) == SUCCESS) {
|
||||
/* Mark array containing partial array as partial */
|
||||
if (IS_PARTIAL_ARRAY(data)) {
|
||||
if (IS_PARTIAL_ARRAY(data) || IS_PARTIAL_OBJECT(data)) {
|
||||
MAKE_PARTIAL_ARRAY(&zv);
|
||||
}
|
||||
SET_RESULT(result, data);
|
||||
@@ -1165,7 +1165,7 @@ static void sccp_visit_instr(scdf_ctx *scdf, zend_op *opline, zend_ssa_op *ssa_o
|
||||
/* We can't add NEXT element into partial array (skip it) */
|
||||
SET_RESULT(result, &zv);
|
||||
} else if (ct_eval_add_array_elem(&zv, op1, op2) == SUCCESS) {
|
||||
if (IS_PARTIAL_ARRAY(op1)) {
|
||||
if (IS_PARTIAL_ARRAY(op1) || IS_PARTIAL_OBJECT(op1)) {
|
||||
MAKE_PARTIAL_ARRAY(&zv);
|
||||
}
|
||||
SET_RESULT(result, &zv);
|
||||
|
||||
Reference in New Issue
Block a user