@@ -4150,15 +4150,18 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_R_SPEC_CONST_HANDLER(
4150
4150
}
4151
4151
4152
4152
properties = Z_OBJPROP_P(array_ptr);
4153
- if (zend_hash_num_elements(properties) == 0) {
4154
- goto fe_reset_r_empty;
4155
- }
4156
-
4157
4153
result = EX_VAR(opline->result.var);
4158
4154
ZVAL_COPY_VALUE(result, array_ptr);
4159
4155
if (IS_CONST != IS_TMP_VAR) {
4160
4156
Z_ADDREF_P(array_ptr);
4161
4157
}
4158
+
4159
+ if (zend_hash_num_elements(properties) == 0) {
4160
+ Z_FE_ITER_P(result) = (uint32_t) -1;
4161
+
4162
+ ZEND_VM_JMP(OP_JMP_ADDR(opline, opline->op2));
4163
+ }
4164
+
4162
4165
Z_FE_ITER_P(result) = zend_hash_iterator_add(properties, 0);
4163
4166
4164
4167
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
@@ -4175,7 +4178,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_R_SPEC_CONST_HANDLER(
4175
4178
}
4176
4179
} else {
4177
4180
zend_error(E_WARNING, "Invalid argument supplied for foreach()");
4178
- fe_reset_r_empty:
4179
4181
ZVAL_UNDEF(EX_VAR(opline->result.var));
4180
4182
Z_FE_ITER_P(EX_VAR(opline->result.var)) = (uint32_t)-1;
4181
4183
@@ -4249,6 +4251,7 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_RW_SPEC_
4249
4251
properties = Z_OBJPROP_P(array_ptr);
4250
4252
if (zend_hash_num_elements(properties) == 0) {
4251
4253
Z_FE_ITER_P(EX_VAR(opline->result.var)) = (uint32_t) -1;
4254
+
4252
4255
ZEND_VM_JMP(OP_JMP_ADDR(opline, opline->op2));
4253
4256
}
4254
4257
@@ -18218,15 +18221,18 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_R_SPEC_TMP_HANDLER(ZE
18218
18221
}
18219
18222
18220
18223
properties = Z_OBJPROP_P(array_ptr);
18221
- if (zend_hash_num_elements(properties) == 0) {
18222
- goto fe_reset_r_empty;
18223
- }
18224
-
18225
18224
result = EX_VAR(opline->result.var);
18226
18225
ZVAL_COPY_VALUE(result, array_ptr);
18227
18226
if (IS_TMP_VAR != IS_TMP_VAR) {
18228
18227
Z_ADDREF_P(array_ptr);
18229
18228
}
18229
+
18230
+ if (zend_hash_num_elements(properties) == 0) {
18231
+ Z_FE_ITER_P(result) = (uint32_t) -1;
18232
+
18233
+ ZEND_VM_JMP(OP_JMP_ADDR(opline, opline->op2));
18234
+ }
18235
+
18230
18236
Z_FE_ITER_P(result) = zend_hash_iterator_add(properties, 0);
18231
18237
18232
18238
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
@@ -18244,7 +18250,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_R_SPEC_TMP_HANDLER(ZE
18244
18250
}
18245
18251
} else {
18246
18252
zend_error(E_WARNING, "Invalid argument supplied for foreach()");
18247
- fe_reset_r_empty:
18248
18253
ZVAL_UNDEF(EX_VAR(opline->result.var));
18249
18254
Z_FE_ITER_P(EX_VAR(opline->result.var)) = (uint32_t)-1;
18250
18255
zval_ptr_dtor_nogc(free_op1);
@@ -18318,6 +18323,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_RW_SPEC_TMP_HANDLER(Z
18318
18323
properties = Z_OBJPROP_P(array_ptr);
18319
18324
if (zend_hash_num_elements(properties) == 0) {
18320
18325
Z_FE_ITER_P(EX_VAR(opline->result.var)) = (uint32_t) -1;
18326
+
18321
18327
ZEND_VM_JMP(OP_JMP_ADDR(opline, opline->op2));
18322
18328
}
18323
18329
@@ -21324,15 +21330,18 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_R_SPEC_VAR_HANDLER(ZE
21324
21330
}
21325
21331
21326
21332
properties = Z_OBJPROP_P(array_ptr);
21327
- if (zend_hash_num_elements(properties) == 0) {
21328
- goto fe_reset_r_empty;
21329
- }
21330
-
21331
21333
result = EX_VAR(opline->result.var);
21332
21334
ZVAL_COPY_VALUE(result, array_ptr);
21333
21335
if (IS_VAR != IS_TMP_VAR) {
21334
21336
Z_ADDREF_P(array_ptr);
21335
21337
}
21338
+
21339
+ if (zend_hash_num_elements(properties) == 0) {
21340
+ Z_FE_ITER_P(result) = (uint32_t) -1;
21341
+ zval_ptr_dtor_nogc(free_op1);
21342
+ ZEND_VM_JMP(OP_JMP_ADDR(opline, opline->op2));
21343
+ }
21344
+
21336
21345
Z_FE_ITER_P(result) = zend_hash_iterator_add(properties, 0);
21337
21346
zval_ptr_dtor_nogc(free_op1);
21338
21347
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
@@ -21350,7 +21359,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_R_SPEC_VAR_HANDLER(ZE
21350
21359
}
21351
21360
} else {
21352
21361
zend_error(E_WARNING, "Invalid argument supplied for foreach()");
21353
- fe_reset_r_empty:
21354
21362
ZVAL_UNDEF(EX_VAR(opline->result.var));
21355
21363
Z_FE_ITER_P(EX_VAR(opline->result.var)) = (uint32_t)-1;
21356
21364
zval_ptr_dtor_nogc(free_op1);
@@ -21424,6 +21432,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_RW_SPEC_VAR_HANDLER(Z
21424
21432
properties = Z_OBJPROP_P(array_ptr);
21425
21433
if (zend_hash_num_elements(properties) == 0) {
21426
21434
Z_FE_ITER_P(EX_VAR(opline->result.var)) = (uint32_t) -1;
21435
+ if (UNEXPECTED(free_op1)) {zval_ptr_dtor_nogc(free_op1);};
21427
21436
ZEND_VM_JMP(OP_JMP_ADDR(opline, opline->op2));
21428
21437
}
21429
21438
@@ -37848,15 +37857,18 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_R_SPEC_CV_HANDLER(ZEN
37848
37857
}
37849
37858
37850
37859
properties = Z_OBJPROP_P(array_ptr);
37851
- if (zend_hash_num_elements(properties) == 0) {
37852
- goto fe_reset_r_empty;
37853
- }
37854
-
37855
37860
result = EX_VAR(opline->result.var);
37856
37861
ZVAL_COPY_VALUE(result, array_ptr);
37857
37862
if (IS_CV != IS_TMP_VAR) {
37858
37863
Z_ADDREF_P(array_ptr);
37859
37864
}
37865
+
37866
+ if (zend_hash_num_elements(properties) == 0) {
37867
+ Z_FE_ITER_P(result) = (uint32_t) -1;
37868
+
37869
+ ZEND_VM_JMP(OP_JMP_ADDR(opline, opline->op2));
37870
+ }
37871
+
37860
37872
Z_FE_ITER_P(result) = zend_hash_iterator_add(properties, 0);
37861
37873
37862
37874
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
@@ -37873,7 +37885,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_R_SPEC_CV_HANDLER(ZEN
37873
37885
}
37874
37886
} else {
37875
37887
zend_error(E_WARNING, "Invalid argument supplied for foreach()");
37876
- fe_reset_r_empty:
37877
37888
ZVAL_UNDEF(EX_VAR(opline->result.var));
37878
37889
Z_FE_ITER_P(EX_VAR(opline->result.var)) = (uint32_t)-1;
37879
37890
@@ -37947,6 +37958,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_RW_SPEC_CV_HANDLER(ZE
37947
37958
properties = Z_OBJPROP_P(array_ptr);
37948
37959
if (zend_hash_num_elements(properties) == 0) {
37949
37960
Z_FE_ITER_P(EX_VAR(opline->result.var)) = (uint32_t) -1;
37961
+
37950
37962
ZEND_VM_JMP(OP_JMP_ADDR(opline, opline->op2));
37951
37963
}
37952
37964
0 commit comments