Skip to content

Commit a90e2dc

Browse files
committed
Move reference check back to slow path
1 parent 7a06e36 commit a90e2dc

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

Zend/zend_vm_def.h

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8884,10 +8884,6 @@ ZEND_VM_COLD_CONST_HANDLER(190, ZEND_COUNT, CONST|TMPVAR|CV, UNUSED)
88848884
SAVE_OPLINE();
88858885
op1 = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R);
88868886

8887-
if ((OP1_TYPE & (IS_VAR|IS_CV)) != 0 && Z_TYPE_P(op1) == IS_REFERENCE) {
8888-
op1 = Z_REFVAL_P(op1);
8889-
}
8890-
88918887
while (1) {
88928888
if (Z_TYPE_P(op1) == IS_ARRAY) {
88938889
count = zend_array_count(Z_ARRVAL_P(op1));
@@ -8917,7 +8913,9 @@ ZEND_VM_COLD_CONST_HANDLER(190, ZEND_COUNT, CONST|TMPVAR|CV, UNUSED)
89178913
}
89188914

89198915
/* If There's no handler and it doesn't implement Countable then emit a TypeError */
8920-
8916+
} else if ((OP1_TYPE & (IS_VAR|IS_CV)) != 0 && Z_TYPE_P(op1) == IS_REFERENCE) {
8917+
op1 = Z_REFVAL_P(op1);
8918+
continue;
89218919
} else if (OP1_TYPE == IS_CV && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) {
89228920
ZVAL_UNDEFINED_OP1();
89238921
}

0 commit comments

Comments
 (0)