Skip to content

Commit bbc67c4

Browse files
committed
Attempt to fix some variable types in VM due to JIT failures
1 parent b548cdb commit bbc67c4

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
@@ -6962,6 +6962,7 @@ ZEND_VM_HANDLER(114, ZEND_ISSET_ISEMPTY_VAR, CONST|TMPVAR|CV, UNUSED, VAR_FETCH|
69626962
{
69636963
USE_OPLINE
69646964
zval *value;
6965+
/* Should be bool result? as below got: result = (opline->extended_value & ZEND_ISEMPTY) */
69656966
int result;
69666967
zval *varname;
69676968
zend_string *name, *tmp_name;
@@ -7007,17 +7008,18 @@ ZEND_VM_HANDLER(180, ZEND_ISSET_ISEMPTY_STATIC_PROP, ANY, CLASS_FETCH, ISSET|CAC
70077008
{
70087009
USE_OPLINE
70097010
zval *value;
7010-
int result;
7011+
zend_result fetch_result;
7012+
bool result;
70117013

70127014
SAVE_OPLINE();
70137015

7014-
result = zend_fetch_static_property_address(&value, NULL, opline->extended_value & ~ZEND_ISEMPTY, BP_VAR_IS, 0 OPLINE_CC EXECUTE_DATA_CC);
7016+
fetch_result = zend_fetch_static_property_address(&value, NULL, opline->extended_value & ~ZEND_ISEMPTY, BP_VAR_IS, 0 OPLINE_CC EXECUTE_DATA_CC);
70157017

70167018
if (!(opline->extended_value & ZEND_ISEMPTY)) {
7017-
result = result == SUCCESS && Z_TYPE_P(value) > IS_NULL &&
7019+
result = fetch_result == SUCCESS && Z_TYPE_P(value) > IS_NULL &&
70187020
(!Z_ISREF_P(value) || Z_TYPE_P(Z_REFVAL_P(value)) != IS_NULL);
70197021
} else {
7020-
result = result != SUCCESS || !i_zend_is_true(value);
7022+
result = fetch_result != SUCCESS || !i_zend_is_true(value);
70217023
}
70227024

70237025
ZEND_VM_SMART_BRANCH(result, 1);
@@ -7027,7 +7029,7 @@ ZEND_VM_COLD_CONSTCONST_HANDLER(115, ZEND_ISSET_ISEMPTY_DIM_OBJ, CONST|TMPVAR|CV
70277029
{
70287030
USE_OPLINE
70297031
zval *container;
7030-
int result;
7032+
bool result;
70317033
zend_ulong hval;
70327034
zval *offset;
70337035

Zend/zend_vm_execute.h

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2405,17 +2405,18 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_STATIC_PROP_SPEC
24052405
{
24062406
USE_OPLINE
24072407
zval *value;
2408-
int result;
2408+
zend_result fetch_result;
2409+
bool result;
24092410

24102411
SAVE_OPLINE();
24112412

2412-
result = zend_fetch_static_property_address(&value, NULL, opline->extended_value & ~ZEND_ISEMPTY, BP_VAR_IS, 0 OPLINE_CC EXECUTE_DATA_CC);
2413+
fetch_result = zend_fetch_static_property_address(&value, NULL, opline->extended_value & ~ZEND_ISEMPTY, BP_VAR_IS, 0 OPLINE_CC EXECUTE_DATA_CC);
24132414

24142415
if (!(opline->extended_value & ZEND_ISEMPTY)) {
2415-
result = result == SUCCESS && Z_TYPE_P(value) > IS_NULL &&
2416+
result = fetch_result == SUCCESS && Z_TYPE_P(value) > IS_NULL &&
24162417
(!Z_ISREF_P(value) || Z_TYPE_P(Z_REFVAL_P(value)) != IS_NULL);
24172418
} else {
2418-
result = result != SUCCESS || !i_zend_is_true(value);
2419+
result = fetch_result != SUCCESS || !i_zend_is_true(value);
24192420
}
24202421

24212422
ZEND_VM_SMART_BRANCH(result, 1);
@@ -6315,7 +6316,7 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM
63156316
{
63166317
USE_OPLINE
63176318
zval *container;
6318-
int result;
6319+
bool result;
63196320
zend_ulong hval;
63206321
zval *offset;
63216322

@@ -8471,7 +8472,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CON
84718472
{
84728473
USE_OPLINE
84738474
zval *container;
8474-
int result;
8475+
bool result;
84758476
zend_ulong hval;
84768477
zval *offset;
84778478

@@ -9425,6 +9426,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_CONST_U
94259426
{
94269427
USE_OPLINE
94279428
zval *value;
9429+
/* Should be bool result? as below got: result = (opline->extended_value & ZEND_ISEMPTY) */
94289430
int result;
94299431
zval *varname;
94309432
zend_string *name, *tmp_name;
@@ -10854,7 +10856,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CON
1085410856
{
1085510857
USE_OPLINE
1085610858
zval *container;
10857-
int result;
10859+
bool result;
1085810860
zend_ulong hval;
1085910861
zval *offset;
1086010862

@@ -14997,7 +14999,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_TMP
1499714999
{
1499815000
USE_OPLINE
1499915001
zval *container;
15000-
int result;
15002+
bool result;
1500115003
zend_ulong hval;
1500215004
zval *offset;
1500315005

@@ -16389,7 +16391,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_TMP
1638916391
{
1639016392
USE_OPLINE
1639116393
zval *container;
16392-
int result;
16394+
bool result;
1639316395
zend_ulong hval;
1639416396
zval *offset;
1639516397

@@ -16787,6 +16789,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_TMPVAR_
1678716789
{
1678816790
USE_OPLINE
1678916791
zval *value;
16792+
/* Should be bool result? as below got: result = (opline->extended_value & ZEND_ISEMPTY) */
1679016793
int result;
1679116794
zval *varname;
1679216795
zend_string *name, *tmp_name;
@@ -17702,7 +17705,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_TMP
1770217705
{
1770317706
USE_OPLINE
1770417707
zval *container;
17705-
int result;
17708+
bool result;
1770617709
zend_ulong hval;
1770717710
zval *offset;
1770817711

@@ -41169,7 +41172,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CV_
4116941172
{
4117041173
USE_OPLINE
4117141174
zval *container;
41172-
int result;
41175+
bool result;
4117341176
zend_ulong hval;
4117441177
zval *offset;
4117541178

@@ -44617,7 +44620,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CV_
4461744620
{
4461844621
USE_OPLINE
4461944622
zval *container;
44620-
int result;
44623+
bool result;
4462144624
zend_ulong hval;
4462244625
zval *offset;
4462344626

@@ -46324,6 +46327,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_CV_UNUS
4632446327
{
4632546328
USE_OPLINE
4632646329
zval *value;
46330+
/* Should be bool result? as below got: result = (opline->extended_value & ZEND_ISEMPTY) */
4632746331
int result;
4632846332
zval *varname;
4632946333
zend_string *name, *tmp_name;
@@ -49739,7 +49743,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CV_
4973949743
{
4974049744
USE_OPLINE
4974149745
zval *container;
49742-
int result;
49746+
bool result;
4974349747
zend_ulong hval;
4974449748
zval *offset;
4974549749

0 commit comments

Comments
 (0)