@@ -4757,7 +4757,7 @@ void zend_compile_switch(zend_ast *ast) /* {{{ */
47574757
47584758 znode expr_node , case_node ;
47594759 zend_op * opline ;
4760- uint32_t * jmpnz_opnums , opnum_default_jmp , opnum_switch ;
4760+ uint32_t * jmpnz_opnums , opnum_default_jmp , opnum_switch = ( uint32_t ) -1 ;
47614761 zend_uchar jumptable_type ;
47624762 HashTable * jumptable = NULL ;
47634763
@@ -4850,6 +4850,7 @@ void zend_compile_switch(zend_ast *ast) /* {{{ */
48504850 zend_update_jump_target_to_next (opnum_default_jmp );
48514851
48524852 if (jumptable ) {
4853+ ZEND_ASSERT (opnum_switch != (uint32_t )-1 );
48534854 opline = & CG (active_op_array )-> opcodes [opnum_switch ];
48544855 opline -> extended_value = get_next_op_number ();
48554856 }
@@ -4942,12 +4943,11 @@ void zend_compile_try(zend_ast *ast) /* {{{ */
49424943 zend_bool is_last_catch = (i + 1 == catches -> children );
49434944
49444945 uint32_t * jmp_multicatch = safe_emalloc (sizeof (uint32_t ), classes -> children - 1 , 0 );
4945- uint32_t opnum_catch ;
4946+ uint32_t opnum_catch = ( uint32_t ) -1 ;
49464947
49474948 CG (zend_lineno ) = catch_ast -> lineno ;
49484949
49494950 for (j = 0 ; j < classes -> children ; j ++ ) {
4950-
49514951 zend_ast * class_ast = classes -> child [j ];
49524952 zend_bool is_last_class = (j + 1 == classes -> children );
49534953
@@ -4997,6 +4997,7 @@ void zend_compile_try(zend_ast *ast) /* {{{ */
49974997 jmp_opnums [i + 1 ] = zend_emit_jump (0 );
49984998 }
49994999
5000+ ZEND_ASSERT (opnum_catch != (uint32_t )-1 && "Should have at least one class" );
50005001 opline = & CG (active_op_array )-> opcodes [opnum_catch ];
50015002 if (!is_last_catch ) {
50025003 opline -> op2 .opline_num = get_next_op_number ();
0 commit comments