Skip to content

Commit 3daff65

Browse files
committed
Attempt to fix some variable types in VM due to JIT failures
1 parent de442bc commit 3daff65

File tree

2 files changed

+24
-18
lines changed

2 files changed

+24
-18
lines changed

Zend/zend_vm_def.h

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6957,6 +6957,7 @@ ZEND_VM_HANDLER(114, ZEND_ISSET_ISEMPTY_VAR, CONST|TMPVAR|CV, UNUSED, VAR_FETCH|
69576957
{
69586958
USE_OPLINE
69596959
zval *value;
6960+
/* Should be bool result? as below got: result = (opline->extended_value & ZEND_ISEMPTY) */
69606961
int result;
69616962
zval *varname;
69626963
zend_string *name, *tmp_name;
@@ -7002,17 +7003,18 @@ ZEND_VM_HANDLER(180, ZEND_ISSET_ISEMPTY_STATIC_PROP, ANY, CLASS_FETCH, ISSET|CAC
70027003
{
70037004
USE_OPLINE
70047005
zval *value;
7005-
int result;
7006+
zend_result fetch_result;
7007+
bool result;
70067008

70077009
SAVE_OPLINE();
70087010

7009-
result = zend_fetch_static_property_address(&value, NULL, opline->extended_value & ~ZEND_ISEMPTY, BP_VAR_IS, 0 OPLINE_CC EXECUTE_DATA_CC);
7011+
fetch_result = zend_fetch_static_property_address(&value, NULL, opline->extended_value & ~ZEND_ISEMPTY, BP_VAR_IS, 0 OPLINE_CC EXECUTE_DATA_CC);
70107012

70117013
if (!(opline->extended_value & ZEND_ISEMPTY)) {
7012-
result = result == SUCCESS && Z_TYPE_P(value) > IS_NULL &&
7014+
result = fetch_result == SUCCESS && Z_TYPE_P(value) > IS_NULL &&
70137015
(!Z_ISREF_P(value) || Z_TYPE_P(Z_REFVAL_P(value)) != IS_NULL);
70147016
} else {
7015-
result = result != SUCCESS || !i_zend_is_true(value);
7017+
result = fetch_result != SUCCESS || !i_zend_is_true(value);
70167018
}
70177019

70187020
ZEND_VM_SMART_BRANCH(result, 1);
@@ -7022,7 +7024,7 @@ ZEND_VM_COLD_CONSTCONST_HANDLER(115, ZEND_ISSET_ISEMPTY_DIM_OBJ, CONST|TMPVAR|CV
70227024
{
70237025
USE_OPLINE
70247026
zval *container;
7025-
int result;
7027+
bool result;
70267028
zend_ulong hval;
70277029
zval *offset;
70287030

Zend/zend_vm_execute.h

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2407,17 +2407,18 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_STATIC_PROP_SPEC
24072407
{
24082408
USE_OPLINE
24092409
zval *value;
2410-
int result;
2410+
zend_result fetch_result;
2411+
bool result;
24112412

24122413
SAVE_OPLINE();
24132414

2414-
result = zend_fetch_static_property_address(&value, NULL, opline->extended_value & ~ZEND_ISEMPTY, BP_VAR_IS, 0 OPLINE_CC EXECUTE_DATA_CC);
2415+
fetch_result = zend_fetch_static_property_address(&value, NULL, opline->extended_value & ~ZEND_ISEMPTY, BP_VAR_IS, 0 OPLINE_CC EXECUTE_DATA_CC);
24152416

24162417
if (!(opline->extended_value & ZEND_ISEMPTY)) {
2417-
result = result == SUCCESS && Z_TYPE_P(value) > IS_NULL &&
2418+
result = fetch_result == SUCCESS && Z_TYPE_P(value) > IS_NULL &&
24182419
(!Z_ISREF_P(value) || Z_TYPE_P(Z_REFVAL_P(value)) != IS_NULL);
24192420
} else {
2420-
result = result != SUCCESS || !i_zend_is_true(value);
2421+
result = fetch_result != SUCCESS || !i_zend_is_true(value);
24212422
}
24222423

24232424
ZEND_VM_SMART_BRANCH(result, 1);
@@ -6314,7 +6315,7 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM
63146315
{
63156316
USE_OPLINE
63166317
zval *container;
6317-
int result;
6318+
bool result;
63186319
zend_ulong hval;
63196320
zval *offset;
63206321

@@ -8470,7 +8471,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CON
84708471
{
84718472
USE_OPLINE
84728473
zval *container;
8473-
int result;
8474+
bool result;
84748475
zend_ulong hval;
84758476
zval *offset;
84768477

@@ -9421,6 +9422,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_CONST_U
94219422
{
94229423
USE_OPLINE
94239424
zval *value;
9425+
/* Should be bool result? as below got: result = (opline->extended_value & ZEND_ISEMPTY) */
94249426
int result;
94259427
zval *varname;
94269428
zend_string *name, *tmp_name;
@@ -10850,7 +10852,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CON
1085010852
{
1085110853
USE_OPLINE
1085210854
zval *container;
10853-
int result;
10855+
bool result;
1085410856
zend_ulong hval;
1085510857
zval *offset;
1085610858

@@ -14991,7 +14993,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_TMP
1499114993
{
1499214994
USE_OPLINE
1499314995
zval *container;
14994-
int result;
14996+
bool result;
1499514997
zend_ulong hval;
1499614998
zval *offset;
1499714999

@@ -16383,7 +16385,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_TMP
1638316385
{
1638416386
USE_OPLINE
1638516387
zval *container;
16386-
int result;
16388+
bool result;
1638716389
zend_ulong hval;
1638816390
zval *offset;
1638916391

@@ -16780,6 +16782,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_TMPVAR_
1678016782
{
1678116783
USE_OPLINE
1678216784
zval *value;
16785+
/* Should be bool result? as below got: result = (opline->extended_value & ZEND_ISEMPTY) */
1678316786
int result;
1678416787
zval *varname;
1678516788
zend_string *name, *tmp_name;
@@ -17695,7 +17698,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_TMP
1769517698
{
1769617699
USE_OPLINE
1769717700
zval *container;
17698-
int result;
17701+
bool result;
1769917702
zend_ulong hval;
1770017703
zval *offset;
1770117704

@@ -41145,7 +41148,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CV_
4114541148
{
4114641149
USE_OPLINE
4114741150
zval *container;
41148-
int result;
41151+
bool result;
4114941152
zend_ulong hval;
4115041153
zval *offset;
4115141154

@@ -44593,7 +44596,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CV_
4459344596
{
4459444597
USE_OPLINE
4459544598
zval *container;
44596-
int result;
44599+
bool result;
4459744600
zend_ulong hval;
4459844601
zval *offset;
4459944602

@@ -46298,6 +46301,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_CV_UNUS
4629846301
{
4629946302
USE_OPLINE
4630046303
zval *value;
46304+
/* Should be bool result? as below got: result = (opline->extended_value & ZEND_ISEMPTY) */
4630146305
int result;
4630246306
zval *varname;
4630346307
zend_string *name, *tmp_name;
@@ -49713,7 +49717,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CV_
4971349717
{
4971449718
USE_OPLINE
4971549719
zval *container;
49716-
int result;
49720+
bool result;
4971749721
zend_ulong hval;
4971849722
zval *offset;
4971949723

0 commit comments

Comments
 (0)