Skip to content

Commit 38be435

Browse files
committed
Boolify zend_VM
1 parent 5548d67 commit 38be435

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

@@ -4978,7 +4978,7 @@ ZEND_VM_C_LABEL(send_again):
49784978
// TODO: Speed this up using a flag that specifies whether there are any ref parameters.
49794979
if ((OP1_TYPE & (IS_VAR|IS_CV)) && Z_REFCOUNT_P(args) > 1) {
49804980
uint32_t tmp_arg_num = arg_num;
4981-
int separate = 0;
4981+
bool separate = 0;
49824982

49834983
/* check if any of arguments are going to be passed by reference */
49844984
ZEND_HASH_FOREACH_STR_KEY_VAL(ht, name, arg) {
@@ -5586,7 +5586,7 @@ ZEND_VM_C_LABEL(case_double):
55865586
}
55875587
} else if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) {
55885588
if (EXPECTED(Z_TYPE_P(op2) == IS_STRING)) {
5589-
int result = zend_fast_equal_strings(Z_STR_P(op1), Z_STR_P(op2));
5589+
bool result = zend_fast_equal_strings(Z_STR_P(op1), Z_STR_P(op2));
55905590
FREE_OP2();
55915591
if (result) {
55925592
ZEND_VM_C_GOTO(case_true);
@@ -6945,7 +6945,7 @@ ZEND_VM_HOT_HANDLER(154, ZEND_ISSET_ISEMPTY_CV, CV, UNUSED, ISSET, SPEC(ISSET))
69456945
ZEND_VM_SMART_BRANCH_FALSE();
69466946
}
69476947
} else {
6948-
int result;
6948+
bool result;
69496949

69506950
SAVE_OPLINE();
69516951
result = !i_zend_is_true(value);
@@ -7262,7 +7262,7 @@ ZEND_VM_COLD_CONST_HANDLER(152, ZEND_JMP_SET, CONST|TMP|VAR|CV, JMP_ADDR)
72627262
USE_OPLINE
72637263
zval *value;
72647264
zval *ref = NULL;
7265-
int ret;
7265+
bool ret;
72667266

72677267
SAVE_OPLINE();
72687268
value = GET_OP1_ZVAL_PTR(BP_VAR_R);
@@ -9200,7 +9200,7 @@ ZEND_VM_HOT_TYPE_SPEC_HANDLER(ZEND_IS_EQUAL|ZEND_IS_IDENTICAL, (op1_info == MAY_
92009200
{
92019201
USE_OPLINE
92029202
zval *op1, *op2;
9203-
int result;
9203+
bool result;
92049204

92059205
op1 = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R);
92069206
op2 = GET_OP2_ZVAL_PTR_UNDEF(BP_VAR_R);
@@ -9212,7 +9212,7 @@ ZEND_VM_HOT_TYPE_SPEC_HANDLER(ZEND_IS_EQUAL|ZEND_IS_IDENTICAL, (op1_info == MAY_
92129212
{
92139213
USE_OPLINE
92149214
zval *op1, *op2;
9215-
int result;
9215+
bool result;
92169216

92179217
op1 = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R);
92189218
op2 = GET_OP2_ZVAL_PTR_UNDEF(BP_VAR_R);
@@ -9224,7 +9224,7 @@ ZEND_VM_HOT_TYPE_SPEC_HANDLER(ZEND_IS_NOT_EQUAL|ZEND_IS_NOT_IDENTICAL, (op1_info
92249224
{
92259225
USE_OPLINE
92269226
zval *op1, *op2;
9227-
int result;
9227+
bool result;
92289228

92299229
op1 = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R);
92309230
op2 = GET_OP2_ZVAL_PTR_UNDEF(BP_VAR_R);
@@ -9236,7 +9236,7 @@ ZEND_VM_HOT_TYPE_SPEC_HANDLER(ZEND_IS_NOT_EQUAL|ZEND_IS_NOT_IDENTICAL, (op1_info
92369236
{
92379237
USE_OPLINE
92389238
zval *op1, *op2;
9239-
int result;
9239+
bool result;
92409240

92419241
op1 = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R);
92429242
op2 = GET_OP2_ZVAL_PTR_UNDEF(BP_VAR_R);
@@ -9277,7 +9277,7 @@ ZEND_VM_HOT_TYPE_SPEC_HANDLER(ZEND_IS_SMALLER, (op1_info == MAY_BE_LONG && op2_i
92779277
{
92789278
USE_OPLINE
92799279
zval *op1, *op2;
9280-
int result;
9280+
bool result;
92819281

92829282
op1 = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R);
92839283
op2 = GET_OP2_ZVAL_PTR_UNDEF(BP_VAR_R);
@@ -9289,7 +9289,7 @@ ZEND_VM_HOT_TYPE_SPEC_HANDLER(ZEND_IS_SMALLER, (op1_info == MAY_BE_DOUBLE && op2
92899289
{
92909290
USE_OPLINE
92919291
zval *op1, *op2;
9292-
int result;
9292+
bool result;
92939293

92949294
op1 = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R);
92959295
op2 = GET_OP2_ZVAL_PTR_UNDEF(BP_VAR_R);
@@ -9301,7 +9301,7 @@ ZEND_VM_HOT_TYPE_SPEC_HANDLER(ZEND_IS_SMALLER_OR_EQUAL, (op1_info == MAY_BE_LONG
93019301
{
93029302
USE_OPLINE
93039303
zval *op1, *op2;
9304-
int result;
9304+
bool result;
93059305

93069306
op1 = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R);
93079307
op2 = GET_OP2_ZVAL_PTR_UNDEF(BP_VAR_R);
@@ -9313,7 +9313,7 @@ ZEND_VM_HOT_TYPE_SPEC_HANDLER(ZEND_IS_SMALLER_OR_EQUAL, (op1_info == MAY_BE_DOUB
93139313
{
93149314
USE_OPLINE
93159315
zval *op1, *op2;
9316-
int result;
9316+
bool result;
93179317

93189318
op1 = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R);
93199319
op2 = GET_OP2_ZVAL_PTR_UNDEF(BP_VAR_R);

0 commit comments

Comments
 (0)