@@ -2705,28 +2705,20 @@ function gen_vm($def, $skel) {
2705
2705
$ else = "" ;
2706
2706
out ($ f , "\tif (spec & SPEC_EXTRA_MASK) { \n" );
2707
2707
2708
- if (isset ($ used_extra_spec ["OP_DATA " ])) {
2709
- out ($ f , "\t\t{$ else }if (spec & SPEC_RULE_OP_DATA) offset = offset * 5 + zend_vm_decode[(op + 1)->op1_type]; \n" );
2710
- $ else = "else " ;
2711
- }
2712
2708
if (isset ($ used_extra_spec ["RETVAL " ])) {
2713
- out ($ f , "\t\t{$ else }if (spec & SPEC_RULE_RETVAL) offset = offset * 2 + (op->result_type != IS_UNUSED); \n" );
2714
- $ else = "else " ;
2709
+ out ($ f , "\t\t{$ else }if (spec & SPEC_RULE_RETVAL) { \n" );
2710
+ out ($ f , "\t\t\toffset = offset * 2 + (op->result_type != IS_UNUSED); \n" );
2711
+ $ else = "} else " ;
2715
2712
}
2716
2713
if (isset ($ used_extra_spec ["QUICK_ARG " ])) {
2717
- out ($ f , "\t\t{$ else }if (spec & SPEC_RULE_QUICK_ARG) offset = offset * 2 + (op->op2.num <= MAX_ARG_FLAG_NUM); \n" );
2718
- $ else = "else " ;
2714
+ out ($ f , "\t\t{$ else }if (spec & SPEC_RULE_QUICK_ARG) { \n" );
2715
+ out ($ f , "\t\t\toffset = offset * 2 + (op->op2.num <= MAX_ARG_FLAG_NUM); \n" );
2716
+ $ else = "} else " ;
2719
2717
}
2720
- if (isset ($ used_extra_spec ["SMART_BRANCH " ])) {
2721
- out ($ f , "\t\t{$ else }if (spec & SPEC_RULE_SMART_BRANCH) { \n" );
2722
- out ($ f , "\t\t\toffset = offset * 3; \n" );
2723
- out ($ f , "\t\t\tif ((op+1)->opcode == ZEND_JMPZ) { \n" );
2724
- out ($ f , "\t\t\t\toffset += 1; \n" );
2725
- out ($ f , "\t\t\t} else if ((op+1)->opcode == ZEND_JMPNZ) { \n" );
2726
- out ($ f , "\t\t\t\toffset += 2; \n" );
2727
- out ($ f , "\t\t\t} \n" );
2728
- out ($ f , "\t\t} \n" );
2729
- $ else = "else " ;
2718
+ if (isset ($ used_extra_spec ["OP_DATA " ])) {
2719
+ out ($ f , "\t\t{$ else }if (spec & SPEC_RULE_OP_DATA) { \n" );
2720
+ out ($ f , "\t\t\toffset = offset * 5 + zend_vm_decode[(op + 1)->op1_type]; \n" );
2721
+ $ else = "} else " ;
2730
2722
}
2731
2723
if (isset ($ used_extra_spec ["DIM_OBJ " ])) {
2732
2724
out ($ f , "\t\t{$ else }if (spec & SPEC_RULE_DIM_OBJ) { \n" );
@@ -2736,12 +2728,25 @@ function gen_vm($def, $skel) {
2736
2728
out ($ f , "\t\t\t} else if (op->extended_value == ZEND_ASSIGN_OBJ) { \n" );
2737
2729
out ($ f , "\t\t\t\toffset += 2; \n" );
2738
2730
out ($ f , "\t\t\t} \n" );
2739
- out ($ f , "\t\t} \n" );
2740
- $ else = "else " ;
2731
+ $ else = "} else " ;
2741
2732
}
2742
2733
if (isset ($ used_extra_spec ["ISSET " ])) {
2743
- out ($ f , "\t\t{$ else }if (spec & SPEC_RULE_ISSET) offset = offset * 2 + (op->extended_value & ZEND_ISEMPTY); \n" );
2744
- $ else = "else " ;
2734
+ out ($ f , "\t\t{$ else }if (spec & SPEC_RULE_ISSET) { \n" );
2735
+ out ($ f , "\t\t\toffset = offset * 2 + (op->extended_value & ZEND_ISEMPTY); \n" );
2736
+ $ else = "} else " ;
2737
+ }
2738
+ if (isset ($ used_extra_spec ["SMART_BRANCH " ])) {
2739
+ out ($ f , "\t\t{$ else }if (spec & SPEC_RULE_SMART_BRANCH) { \n" );
2740
+ out ($ f , "\t\t\toffset = offset * 3; \n" );
2741
+ out ($ f , "\t\t\tif ((op+1)->opcode == ZEND_JMPZ) { \n" );
2742
+ out ($ f , "\t\t\t\toffset += 1; \n" );
2743
+ out ($ f , "\t\t\t} else if ((op+1)->opcode == ZEND_JMPNZ) { \n" );
2744
+ out ($ f , "\t\t\t\toffset += 2; \n" );
2745
+ out ($ f , "\t\t\t} \n" );
2746
+ $ else = "} else " ;
2747
+ }
2748
+ if ($ else !== "" ) {
2749
+ out ($ f , "\t\t} \n" );
2745
2750
}
2746
2751
out ($ f , "\t} \n" );
2747
2752
}
0 commit comments