Skip to content

Commit c16dbed

Browse files
committed
Avoid recording of uninitialized types.
VM doesn't set Z_TYPE() for IS_VAR when passes class_entry reference.
1 parent 58cb0e4 commit c16dbed

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

ext/opcache/jit/zend_jit_vm_helpers.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,11 @@ zend_jit_trace_stop ZEND_FASTCALL zend_jit_trace_execute(zend_execute_data *ex,
556556
ce1 = ce2 = NULL;
557557
op1_type = op2_type = op3_type = IS_UNKNOWN;
558558
if ((opline->op1_type & (IS_TMP_VAR|IS_VAR|IS_CV))
559-
&& (opline->opcode != ZEND_ROPE_ADD && opline->opcode != ZEND_ROPE_END)) {
559+
&& opline->opcode != ZEND_ROPE_ADD
560+
&& opline->opcode != ZEND_ROPE_END
561+
&& opline->opcode != ZEND_NEW
562+
&& opline->opcode != ZEND_FETCH_CLASS_CONSTANT
563+
&& opline->opcode != ZEND_INIT_STATIC_METHOD_CALL) {
560564
zval *zv = EX_VAR(opline->op1.var);
561565
op1_type = Z_TYPE_P(zv);
562566
uint8_t flags = 0;
@@ -576,7 +580,9 @@ zend_jit_trace_stop ZEND_FASTCALL zend_jit_trace_execute(zend_execute_data *ex,
576580
ce1 = Z_OBJCE_P(zv);
577581
}
578582
}
579-
if (opline->op2_type & (IS_TMP_VAR|IS_VAR|IS_CV)) {
583+
if (opline->op2_type & (IS_TMP_VAR|IS_VAR|IS_CV)
584+
&& opline->opcode != ZEND_INSTANCEOF
585+
&& opline->opcode != ZEND_UNSET_STATIC_PROP) {
580586
zval *zv = EX_VAR(opline->op2.var);
581587
uint8_t flags = 0;
582588

0 commit comments

Comments
 (0)