Skip to content

Commit 93ed195

Browse files
committed
Fix opcache
1 parent d66d722 commit 93ed195

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

Zend/Optimizer/sccp.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1106,6 +1106,11 @@ static void sccp_visit_instr(scdf_ctx *scdf, zend_op *opline, zend_ssa_op *ssa_o
11061106

11071107
if (op2) {
11081108
SKIP_IF_TOP(op2);
1109+
if (Z_TYPE_P(op2) == IS_NULL) {
1110+
/* Emits deprecation at run-time. */
1111+
SET_RESULT_BOT(result);
1112+
return;
1113+
}
11091114
}
11101115

11111116
/* We want to avoid keeping around intermediate arrays for each SSA variable in the
@@ -2288,7 +2293,7 @@ static uint32_t try_remove_definition(sccp_ctx *ctx, int var_num, zend_ssa_var *
22882293
break;
22892294
case ZEND_INIT_ARRAY:
22902295
case ZEND_ADD_ARRAY_ELEMENT:
2291-
if (opline->op2_type == IS_UNUSED) {
2296+
if (opline->op2_type == IS_UNUSED || opline->op2_type == IS_NULL) {
22922297
return 0;
22932298
}
22942299
/* break missing intentionally */

Zend/Optimizer/zend_inference.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5253,7 +5253,7 @@ ZEND_API bool zend_may_throw_ex(const zend_op *opline, const zend_ssa_op *ssa_op
52535253
case ZEND_INIT_ARRAY:
52545254
return (opline->op2_type != IS_UNUSED) && (t2 & (MAY_BE_ARRAY|MAY_BE_OBJECT|MAY_BE_RESOURCE));
52555255
case ZEND_ADD_ARRAY_ELEMENT:
5256-
return (opline->op2_type == IS_UNUSED) || (t2 & (MAY_BE_ARRAY|MAY_BE_OBJECT|MAY_BE_RESOURCE));
5256+
return (opline->op2_type == IS_UNUSED) || (t2 & (MAY_BE_NULL|MAY_BE_ARRAY|MAY_BE_OBJECT|MAY_BE_RESOURCE));
52575257
case ZEND_STRLEN:
52585258
return (t1 & MAY_BE_ANY) != MAY_BE_STRING;
52595259
case ZEND_COUNT:

0 commit comments

Comments
 (0)