Skip to content

Commit 400a65f

Browse files
committed
Boolify zend_VM
1 parent fa1ff71 commit 400a65f

File tree

2 files changed

+124
-124
lines changed

2 files changed

+124
-124
lines changed

Zend/zend_vm_def.h

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,7 @@ ZEND_VM_C_LABEL(is_equal_double):
549549
}
550550
} else if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) {
551551
if (EXPECTED(Z_TYPE_P(op2) == IS_STRING)) {
552-
int result = zend_fast_equal_strings(Z_STR_P(op1), Z_STR_P(op2));
552+
bool result = zend_fast_equal_strings(Z_STR_P(op1), Z_STR_P(op2));
553553
if (OP1_TYPE & (IS_TMP_VAR|IS_VAR)) {
554554
zval_ptr_dtor_str(op1);
555555
}
@@ -629,7 +629,7 @@ ZEND_VM_C_LABEL(is_not_equal_double):
629629
}
630630
} else if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) {
631631
if (EXPECTED(Z_TYPE_P(op2) == IS_STRING)) {
632-
int result = zend_fast_equal_strings(Z_STR_P(op1), Z_STR_P(op2));
632+
bool result = zend_fast_equal_strings(Z_STR_P(op1), Z_STR_P(op2));
633633
if (OP1_TYPE & (IS_TMP_VAR|IS_VAR)) {
634634
zval_ptr_dtor_str(op1);
635635
}
@@ -2993,7 +2993,7 @@ ZEND_VM_COLD_CONST_HANDLER(46, ZEND_JMPZ_EX, CONST|TMPVAR|CV, JMP_ADDR)
29932993
{
29942994
USE_OPLINE
29952995
zval *val;
2996-
int ret;
2996+
bool ret;
29972997

29982998
val = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R);
29992999

@@ -3029,7 +3029,7 @@ ZEND_VM_COLD_CONST_HANDLER(47, ZEND_JMPNZ_EX, CONST|TMPVAR|CV, JMP_ADDR)
30293029
{
30303030
USE_OPLINE
30313031
zval *val;
3032-
int ret;
3032+
bool ret;
30333033

30343034
val = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R);
30353035

@@ -4966,7 +4966,7 @@ ZEND_VM_C_LABEL(send_again):
49664966
// TODO: Speed this up using a flag that specifies whether there are any ref parameters.
49674967
if ((OP1_TYPE & (IS_VAR|IS_CV)) && Z_REFCOUNT_P(args) > 1) {
49684968
uint32_t tmp_arg_num = arg_num;
4969-
int separate = 0;
4969+
bool separate = 0;
49704970

49714971
/* check if any of arguments are going to be passed by reference */
49724972
ZEND_HASH_FOREACH_STR_KEY_VAL(ht, name, arg) {
@@ -5560,7 +5560,7 @@ ZEND_VM_C_LABEL(case_double):
55605560
}
55615561
} else if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) {
55625562
if (EXPECTED(Z_TYPE_P(op2) == IS_STRING)) {
5563-
int result = zend_fast_equal_strings(Z_STR_P(op1), Z_STR_P(op2));
5563+
bool result = zend_fast_equal_strings(Z_STR_P(op1), Z_STR_P(op2));
55645564
FREE_OP2();
55655565
if (result) {
55665566
ZEND_VM_C_GOTO(case_true);
@@ -6919,7 +6919,7 @@ ZEND_VM_HOT_HANDLER(154, ZEND_ISSET_ISEMPTY_CV, CV, UNUSED, ISSET, SPEC(ISSET))
69196919
ZEND_VM_SMART_BRANCH_FALSE();
69206920
}
69216921
} else {
6922-
int result;
6922+
bool result;
69236923

69246924
SAVE_OPLINE();
69256925
result = !i_zend_is_true(value);
@@ -7236,7 +7236,7 @@ ZEND_VM_COLD_CONST_HANDLER(152, ZEND_JMP_SET, CONST|TMP|VAR|CV, JMP_ADDR)
72367236
USE_OPLINE
72377237
zval *value;
72387238
zval *ref = NULL;
7239-
int ret;
7239+
bool ret;
72407240

72417241
SAVE_OPLINE();
72427242
value = GET_OP1_ZVAL_PTR(BP_VAR_R);
@@ -9174,7 +9174,7 @@ ZEND_VM_HOT_TYPE_SPEC_HANDLER(ZEND_IS_EQUAL|ZEND_IS_IDENTICAL, (op1_info == MAY_
91749174
{
91759175
USE_OPLINE
91769176
zval *op1, *op2;
9177-
int result;
9177+
bool result;
91789178

91799179
op1 = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R);
91809180
op2 = GET_OP2_ZVAL_PTR_UNDEF(BP_VAR_R);
@@ -9186,7 +9186,7 @@ ZEND_VM_HOT_TYPE_SPEC_HANDLER(ZEND_IS_EQUAL|ZEND_IS_IDENTICAL, (op1_info == MAY_
91869186
{
91879187
USE_OPLINE
91889188
zval *op1, *op2;
9189-
int result;
9189+
bool result;
91909190

91919191
op1 = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R);
91929192
op2 = GET_OP2_ZVAL_PTR_UNDEF(BP_VAR_R);
@@ -9198,7 +9198,7 @@ ZEND_VM_HOT_TYPE_SPEC_HANDLER(ZEND_IS_NOT_EQUAL|ZEND_IS_NOT_IDENTICAL, (op1_info
91989198
{
91999199
USE_OPLINE
92009200
zval *op1, *op2;
9201-
int result;
9201+
bool result;
92029202

92039203
op1 = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R);
92049204
op2 = GET_OP2_ZVAL_PTR_UNDEF(BP_VAR_R);
@@ -9210,7 +9210,7 @@ ZEND_VM_HOT_TYPE_SPEC_HANDLER(ZEND_IS_NOT_EQUAL|ZEND_IS_NOT_IDENTICAL, (op1_info
92109210
{
92119211
USE_OPLINE
92129212
zval *op1, *op2;
9213-
int result;
9213+
bool result;
92149214

92159215
op1 = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R);
92169216
op2 = GET_OP2_ZVAL_PTR_UNDEF(BP_VAR_R);
@@ -9251,7 +9251,7 @@ ZEND_VM_HOT_TYPE_SPEC_HANDLER(ZEND_IS_SMALLER, (op1_info == MAY_BE_LONG && op2_i
92519251
{
92529252
USE_OPLINE
92539253
zval *op1, *op2;
9254-
int result;
9254+
bool result;
92559255

92569256
op1 = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R);
92579257
op2 = GET_OP2_ZVAL_PTR_UNDEF(BP_VAR_R);
@@ -9263,7 +9263,7 @@ ZEND_VM_HOT_TYPE_SPEC_HANDLER(ZEND_IS_SMALLER, (op1_info == MAY_BE_DOUBLE && op2
92639263
{
92649264
USE_OPLINE
92659265
zval *op1, *op2;
9266-
int result;
9266+
bool result;
92679267

92689268
op1 = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R);
92699269
op2 = GET_OP2_ZVAL_PTR_UNDEF(BP_VAR_R);
@@ -9275,7 +9275,7 @@ ZEND_VM_HOT_TYPE_SPEC_HANDLER(ZEND_IS_SMALLER_OR_EQUAL, (op1_info == MAY_BE_LONG
92759275
{
92769276
USE_OPLINE
92779277
zval *op1, *op2;
9278-
int result;
9278+
bool result;
92799279

92809280
op1 = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R);
92819281
op2 = GET_OP2_ZVAL_PTR_UNDEF(BP_VAR_R);
@@ -9287,7 +9287,7 @@ ZEND_VM_HOT_TYPE_SPEC_HANDLER(ZEND_IS_SMALLER_OR_EQUAL, (op1_info == MAY_BE_DOUB
92879287
{
92889288
USE_OPLINE
92899289
zval *op1, *op2;
9290-
int result;
9290+
bool result;
92919291

92929292
op1 = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R);
92939293
op2 = GET_OP2_ZVAL_PTR_UNDEF(BP_VAR_R);

0 commit comments

Comments
 (0)