| 1554 | } |
| 1555 | |
| 1556 | static void compile_emit_loop_jump( compiler * c, int32_t type ) |
| 1557 | { |
| 1558 | struct loop_info * info = NULL; |
| 1559 | int32_t i; |
| 1560 | for ( i = c->loop_scopes->size; --i >= 0; ) |
| 1561 | { |
| 1562 | struct loop_info * elem = &dynamic_array_at( struct loop_info, c->loop_scopes, i ); |
| 1563 | if ( elem->type == type ) |
| 1564 | { |
| 1565 | info = elem; |
| 1566 | break; |
| 1567 | } |
| 1568 | } |
| 1569 | if ( info == NULL ) |
| 1570 | { |
| 1571 | printf( "warning: ignoring break statement used outside of loop\n" ); |
| 1572 | return; |
| 1573 | } |
| 1574 | compile_emit_cleanups( c, info->cleanup_depth ); |
| 1575 | compile_emit_branch( c, INSTR_JUMP, info->label ); |
| 1576 | } |
| 1577 | |
| 1578 | static void compile_push_break_scope( compiler * c, int32_t label ) |
| 1579 | { |
no test coverage detected