Skip to content

Commit 18a672b

Browse files
committed
Fix undefined zval check
1 parent aec0a54 commit 18a672b

File tree

2 files changed

+22
-22
lines changed

2 files changed

+22
-22
lines changed

Zend/zend_vm_def.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,7 @@ ZEND_VM_C_LABEL(compare_values_any_type):
487487
}
488488
ZEND_VM_C_LABEL(compare_values):
489489
if (Z_TYPE_P(op1) <= IS_TRUE) {
490-
if (((OP1_TYPE & IS_CV) || (OP2_TYPE & IS_CV)) && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) {
490+
if (((OP1_TYPE & IS_CV) && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) || ((OP2_TYPE & IS_CV) && UNEXPECTED(Z_TYPE_P(op2) == IS_UNDEF))) {
491491
/* They are both undefined - fetch them to emit the undefined variable warnings. */
492492
op1 = ZVAL_UNDEFINED_OP1();
493493
op2 = ZVAL_UNDEFINED_OP2();
@@ -588,7 +588,7 @@ ZEND_VM_C_LABEL(compare_values_any_type):
588588
}
589589
ZEND_VM_C_LABEL(compare_values):
590590
if (Z_TYPE_P(op1) <= IS_TRUE) {
591-
if (((OP1_TYPE & IS_CV) || (OP2_TYPE & IS_CV)) && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) {
591+
if (((OP1_TYPE & IS_CV) && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) || ((OP2_TYPE & IS_CV) && UNEXPECTED(Z_TYPE_P(op2) == IS_UNDEF))) {
592592
/* They are both undefined - fetch them to emit the undefined variable warnings. */
593593
op1 = ZVAL_UNDEFINED_OP1();
594594
op2 = ZVAL_UNDEFINED_OP2();

Zend/zend_vm_execute.h

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4799,7 +4799,7 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC
47994799
}
48004800
compare_values:
48014801
if (Z_TYPE_P(op1) <= IS_TRUE) {
4802-
if (((IS_CONST & IS_CV) || (IS_CONST & IS_CV)) && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) {
4802+
if (((IS_CONST & IS_CV) && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) || ((IS_CONST & IS_CV) && UNEXPECTED(Z_TYPE_P(op2) == IS_UNDEF))) {
48034803
/* They are both undefined - fetch them to emit the undefined variable warnings. */
48044804
op1 = ZVAL_UNDEFINED_OP1();
48054805
op2 = ZVAL_UNDEFINED_OP2();
@@ -4900,7 +4900,7 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_
49004900
}
49014901
compare_values:
49024902
if (Z_TYPE_P(op1) <= IS_TRUE) {
4903-
if (((IS_CONST & IS_CV) || (IS_CONST & IS_CV)) && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) {
4903+
if (((IS_CONST & IS_CV) && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) || ((IS_CONST & IS_CV) && UNEXPECTED(Z_TYPE_P(op2) == IS_UNDEF))) {
49044904
/* They are both undefined - fetch them to emit the undefined variable warnings. */
49054905
op1 = ZVAL_UNDEFINED_OP1();
49064906
op2 = ZVAL_UNDEFINED_OP2();
@@ -18007,7 +18007,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_TMP_CONST_HA
1800718007
}
1800818008
compare_values:
1800918009
if (Z_TYPE_P(op1) <= IS_TRUE) {
18010-
if (((IS_TMP_VAR & IS_CV) || (IS_CONST & IS_CV)) && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) {
18010+
if (((IS_TMP_VAR & IS_CV) && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) || ((IS_CONST & IS_CV) && UNEXPECTED(Z_TYPE_P(op2) == IS_UNDEF))) {
1801118011
/* They are both undefined - fetch them to emit the undefined variable warnings. */
1801218012
op1 = ZVAL_UNDEFINED_OP1();
1801318013
op2 = ZVAL_UNDEFINED_OP2();
@@ -18108,7 +18108,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_TMP_CONS
1810818108
}
1810918109
compare_values:
1811018110
if (Z_TYPE_P(op1) <= IS_TRUE) {
18111-
if (((IS_TMP_VAR & IS_CV) || (IS_CONST & IS_CV)) && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) {
18111+
if (((IS_TMP_VAR & IS_CV) && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) || ((IS_CONST & IS_CV) && UNEXPECTED(Z_TYPE_P(op2) == IS_UNDEF))) {
1811218112
/* They are both undefined - fetch them to emit the undefined variable warnings. */
1811318113
op1 = ZVAL_UNDEFINED_OP1();
1811418114
op2 = ZVAL_UNDEFINED_OP2();
@@ -18980,7 +18980,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_TMP_TMP_HAND
1898018980
}
1898118981
compare_values:
1898218982
if (Z_TYPE_P(op1) <= IS_TRUE) {
18983-
if (((IS_TMP_VAR & IS_CV) || (IS_TMP_VAR & IS_CV)) && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) {
18983+
if (((IS_TMP_VAR & IS_CV) && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) || ((IS_TMP_VAR & IS_CV) && UNEXPECTED(Z_TYPE_P(op2) == IS_UNDEF))) {
1898418984
/* They are both undefined - fetch them to emit the undefined variable warnings. */
1898518985
op1 = ZVAL_UNDEFINED_OP1();
1898618986
op2 = ZVAL_UNDEFINED_OP2();
@@ -19081,7 +19081,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_TMP_TMP_
1908119081
}
1908219082
compare_values:
1908319083
if (Z_TYPE_P(op1) <= IS_TRUE) {
19084-
if (((IS_TMP_VAR & IS_CV) || (IS_TMP_VAR & IS_CV)) && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) {
19084+
if (((IS_TMP_VAR & IS_CV) && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) || ((IS_TMP_VAR & IS_CV) && UNEXPECTED(Z_TYPE_P(op2) == IS_UNDEF))) {
1908519085
/* They are both undefined - fetch them to emit the undefined variable warnings. */
1908619086
op1 = ZVAL_UNDEFINED_OP1();
1908719087
op2 = ZVAL_UNDEFINED_OP2();
@@ -21361,7 +21361,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_VAR_CONST_HA
2136121361
}
2136221362
compare_values:
2136321363
if (Z_TYPE_P(op1) <= IS_TRUE) {
21364-
if (((IS_VAR & IS_CV) || (IS_CONST & IS_CV)) && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) {
21364+
if (((IS_VAR & IS_CV) && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) || ((IS_CONST & IS_CV) && UNEXPECTED(Z_TYPE_P(op2) == IS_UNDEF))) {
2136521365
/* They are both undefined - fetch them to emit the undefined variable warnings. */
2136621366
op1 = ZVAL_UNDEFINED_OP1();
2136721367
op2 = ZVAL_UNDEFINED_OP2();
@@ -21462,7 +21462,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_VAR_CONS
2146221462
}
2146321463
compare_values:
2146421464
if (Z_TYPE_P(op1) <= IS_TRUE) {
21465-
if (((IS_VAR & IS_CV) || (IS_CONST & IS_CV)) && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) {
21465+
if (((IS_VAR & IS_CV) && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) || ((IS_CONST & IS_CV) && UNEXPECTED(Z_TYPE_P(op2) == IS_UNDEF))) {
2146621466
/* They are both undefined - fetch them to emit the undefined variable warnings. */
2146721467
op1 = ZVAL_UNDEFINED_OP1();
2146821468
op2 = ZVAL_UNDEFINED_OP2();
@@ -25904,7 +25904,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_VAR_TMP_HAND
2590425904
}
2590525905
compare_values:
2590625906
if (Z_TYPE_P(op1) <= IS_TRUE) {
25907-
if (((IS_VAR & IS_CV) || (IS_TMP_VAR & IS_CV)) && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) {
25907+
if (((IS_VAR & IS_CV) && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) || ((IS_TMP_VAR & IS_CV) && UNEXPECTED(Z_TYPE_P(op2) == IS_UNDEF))) {
2590825908
/* They are both undefined - fetch them to emit the undefined variable warnings. */
2590925909
op1 = ZVAL_UNDEFINED_OP1();
2591025910
op2 = ZVAL_UNDEFINED_OP2();
@@ -26005,7 +26005,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_VAR_TMP_
2600526005
}
2600626006
compare_values:
2600726007
if (Z_TYPE_P(op1) <= IS_TRUE) {
26008-
if (((IS_VAR & IS_CV) || (IS_TMP_VAR & IS_CV)) && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) {
26008+
if (((IS_VAR & IS_CV) && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) || ((IS_TMP_VAR & IS_CV) && UNEXPECTED(Z_TYPE_P(op2) == IS_UNDEF))) {
2600926009
/* They are both undefined - fetch them to emit the undefined variable warnings. */
2601026010
op1 = ZVAL_UNDEFINED_OP1();
2601126011
op2 = ZVAL_UNDEFINED_OP2();
@@ -26146,7 +26146,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_VAR_VAR_HAND
2614626146
}
2614726147
compare_values:
2614826148
if (Z_TYPE_P(op1) <= IS_TRUE) {
26149-
if (((IS_VAR & IS_CV) || (IS_VAR & IS_CV)) && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) {
26149+
if (((IS_VAR & IS_CV) && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) || ((IS_VAR & IS_CV) && UNEXPECTED(Z_TYPE_P(op2) == IS_UNDEF))) {
2615026150
/* They are both undefined - fetch them to emit the undefined variable warnings. */
2615126151
op1 = ZVAL_UNDEFINED_OP1();
2615226152
op2 = ZVAL_UNDEFINED_OP2();
@@ -26247,7 +26247,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_VAR_VAR_
2624726247
}
2624826248
compare_values:
2624926249
if (Z_TYPE_P(op1) <= IS_TRUE) {
26250-
if (((IS_VAR & IS_CV) || (IS_VAR & IS_CV)) && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) {
26250+
if (((IS_VAR & IS_CV) && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) || ((IS_VAR & IS_CV) && UNEXPECTED(Z_TYPE_P(op2) == IS_UNDEF))) {
2625126251
/* They are both undefined - fetch them to emit the undefined variable warnings. */
2625226252
op1 = ZVAL_UNDEFINED_OP1();
2625326253
op2 = ZVAL_UNDEFINED_OP2();
@@ -37797,7 +37797,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_CV_CONST_HAN
3779737797
}
3779837798
compare_values:
3779937799
if (Z_TYPE_P(op1) <= IS_TRUE) {
37800-
if (((IS_CV & IS_CV) || (IS_CONST & IS_CV)) && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) {
37800+
if (((IS_CV & IS_CV) && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) || ((IS_CONST & IS_CV) && UNEXPECTED(Z_TYPE_P(op2) == IS_UNDEF))) {
3780137801
/* They are both undefined - fetch them to emit the undefined variable warnings. */
3780237802
op1 = ZVAL_UNDEFINED_OP1();
3780337803
op2 = ZVAL_UNDEFINED_OP2();
@@ -37898,7 +37898,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CV_CONST
3789837898
}
3789937899
compare_values:
3790037900
if (Z_TYPE_P(op1) <= IS_TRUE) {
37901-
if (((IS_CV & IS_CV) || (IS_CONST & IS_CV)) && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) {
37901+
if (((IS_CV & IS_CV) && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) || ((IS_CONST & IS_CV) && UNEXPECTED(Z_TYPE_P(op2) == IS_UNDEF))) {
3790237902
/* They are both undefined - fetch them to emit the undefined variable warnings. */
3790337903
op1 = ZVAL_UNDEFINED_OP1();
3790437904
op2 = ZVAL_UNDEFINED_OP2();
@@ -44447,7 +44447,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_CV_TMP_HANDL
4444744447
}
4444844448
compare_values:
4444944449
if (Z_TYPE_P(op1) <= IS_TRUE) {
44450-
if (((IS_CV & IS_CV) || (IS_TMP_VAR & IS_CV)) && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) {
44450+
if (((IS_CV & IS_CV) && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) || ((IS_TMP_VAR & IS_CV) && UNEXPECTED(Z_TYPE_P(op2) == IS_UNDEF))) {
4445144451
/* They are both undefined - fetch them to emit the undefined variable warnings. */
4445244452
op1 = ZVAL_UNDEFINED_OP1();
4445344453
op2 = ZVAL_UNDEFINED_OP2();
@@ -44548,7 +44548,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CV_TMP_H
4454844548
}
4454944549
compare_values:
4455044550
if (Z_TYPE_P(op1) <= IS_TRUE) {
44551-
if (((IS_CV & IS_CV) || (IS_TMP_VAR & IS_CV)) && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) {
44551+
if (((IS_CV & IS_CV) && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) || ((IS_TMP_VAR & IS_CV) && UNEXPECTED(Z_TYPE_P(op2) == IS_UNDEF))) {
4455244552
/* They are both undefined - fetch them to emit the undefined variable warnings. */
4455344553
op1 = ZVAL_UNDEFINED_OP1();
4455444554
op2 = ZVAL_UNDEFINED_OP2();
@@ -44689,7 +44689,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_CV_VAR_HANDL
4468944689
}
4469044690
compare_values:
4469144691
if (Z_TYPE_P(op1) <= IS_TRUE) {
44692-
if (((IS_CV & IS_CV) || (IS_VAR & IS_CV)) && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) {
44692+
if (((IS_CV & IS_CV) && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) || ((IS_VAR & IS_CV) && UNEXPECTED(Z_TYPE_P(op2) == IS_UNDEF))) {
4469344693
/* They are both undefined - fetch them to emit the undefined variable warnings. */
4469444694
op1 = ZVAL_UNDEFINED_OP1();
4469544695
op2 = ZVAL_UNDEFINED_OP2();
@@ -44790,7 +44790,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CV_VAR_H
4479044790
}
4479144791
compare_values:
4479244792
if (Z_TYPE_P(op1) <= IS_TRUE) {
44793-
if (((IS_CV & IS_CV) || (IS_VAR & IS_CV)) && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) {
44793+
if (((IS_CV & IS_CV) && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) || ((IS_VAR & IS_CV) && UNEXPECTED(Z_TYPE_P(op2) == IS_UNDEF))) {
4479444794
/* They are both undefined - fetch them to emit the undefined variable warnings. */
4479544795
op1 = ZVAL_UNDEFINED_OP1();
4479644796
op2 = ZVAL_UNDEFINED_OP2();
@@ -46516,7 +46516,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_CV_CV_HANDLE
4651646516
}
4651746517
compare_values:
4651846518
if (Z_TYPE_P(op1) <= IS_TRUE) {
46519-
if (((IS_CV & IS_CV) || (IS_CV & IS_CV)) && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) {
46519+
if (((IS_CV & IS_CV) && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) || ((IS_CV & IS_CV) && UNEXPECTED(Z_TYPE_P(op2) == IS_UNDEF))) {
4652046520
/* They are both undefined - fetch them to emit the undefined variable warnings. */
4652146521
op1 = ZVAL_UNDEFINED_OP1();
4652246522
op2 = ZVAL_UNDEFINED_OP2();
@@ -46617,7 +46617,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CV_CV_HA
4661746617
}
4661846618
compare_values:
4661946619
if (Z_TYPE_P(op1) <= IS_TRUE) {
46620-
if (((IS_CV & IS_CV) || (IS_CV & IS_CV)) && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) {
46620+
if (((IS_CV & IS_CV) && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) || ((IS_CV & IS_CV) && UNEXPECTED(Z_TYPE_P(op2) == IS_UNDEF))) {
4662146621
/* They are both undefined - fetch them to emit the undefined variable warnings. */
4662246622
op1 = ZVAL_UNDEFINED_OP1();
4662346623
op2 = ZVAL_UNDEFINED_OP2();

0 commit comments

Comments
 (0)