MCPcopy Create free account
hub / github.com/Meridian59/Meridian59 / codegen_exit_loop

Function codegen_exit_loop

blakcomp/codegen.c:393–406  ·  view source on GitHub ↗

/ * codegen_exit_loop: Fix up loop stack when a loop is exited. Break statements * jump to the current file position. */

Source from the content-addressed store, hash-verified

391 * jump to the current file position.
392 */
393void codegen_exit_loop(void)
394{
395 list_type p;
396
397 /* Backpatch break statements to jump to end of loop */
398 for (p = current_loop->break_list; p != NULL; p = p->next)
399 BackpatchGoto(outfile, *((int *)(&p->data)), FileCurPos(outfile));
400
401 /* Remove current list from loop "stack" */
402 loop_stack = list_delete_first(loop_stack);
403
404 /* Restore current_loop to correct state */
405 current_loop = (loop_type) list_first_item(loop_stack);
406}
407/************************************************************************/
408/*
409 * codegen_while: Generate code for a while loop statement.

Callers 2

codegen_whileFunction · 0.85
codegen_forFunction · 0.85

Calls 3

BackpatchGotoFunction · 0.85
list_delete_firstFunction · 0.70
list_first_itemFunction · 0.70

Tested by

no test coverage detected