@@ -5297,6 +5297,23 @@ void zend_compile_match(znode *result, zend_ast *ast)
5297
5297
uint32_t cond_count = 0 ;
5298
5298
uint32_t * jmp_end_opnums = safe_emalloc (sizeof (uint32_t ), arms -> children , 0 );
5299
5299
5300
+ if (!has_default_arm ) {
5301
+ if (!uses_jumptable ) {
5302
+ zend_update_jump_target_to_next (opnum_default_jmp );
5303
+ }
5304
+
5305
+ if (jumptable ) {
5306
+ zend_op * opline = & CG (active_op_array )-> opcodes [opnum_match ];
5307
+ opline -> extended_value = get_next_op_number ();
5308
+ }
5309
+
5310
+ CG (zend_lineno ) = ast -> lineno ;
5311
+ zend_op * opline = zend_emit_op (NULL , ZEND_MATCH_ERROR , & expr_node , NULL );
5312
+ if (opline -> op1_type == IS_CONST ) {
5313
+ Z_TRY_ADDREF_P (CT_CONSTANT (opline -> op1 ));
5314
+ }
5315
+ }
5316
+
5300
5317
for (uint32_t i = 0 ; i < arms -> children ; ++ i ) {
5301
5318
zend_ast * arm_ast = arms -> child [i ];
5302
5319
zend_ast * body_ast = arm_ast -> child [1 ];
@@ -5358,22 +5375,6 @@ void zend_compile_match(znode *result, zend_ast *ast)
5358
5375
ZVAL_NULL (& result -> u .constant );
5359
5376
}
5360
5377
5361
- if (!has_default_arm ) {
5362
- if (!uses_jumptable ) {
5363
- zend_update_jump_target_to_next (opnum_default_jmp );
5364
- }
5365
-
5366
- if (jumptable ) {
5367
- zend_op * opline = & CG (active_op_array )-> opcodes [opnum_match ];
5368
- opline -> extended_value = get_next_op_number ();
5369
- }
5370
-
5371
- zend_op * opline = zend_emit_op (NULL , ZEND_MATCH_ERROR , & expr_node , NULL );
5372
- if (opline -> op1_type == IS_CONST ) {
5373
- Z_TRY_ADDREF_P (CT_CONSTANT (opline -> op1 ));
5374
- }
5375
- }
5376
-
5377
5378
for (uint32_t i = 0 ; i < arms -> children ; ++ i ) {
5378
5379
zend_update_jump_target_to_next (jmp_end_opnums [i ]);
5379
5380
}
0 commit comments