diff --git a/ps6/src/generator.c b/ps6/src/generator.c index d594887..ee7a502 100644 --- a/ps6/src/generator.c +++ b/ps6/src/generator.c @@ -527,6 +527,12 @@ static void generate_break_statement() // Generate the break statement, jumping out past the end of the current innermost while loop. // You can use a global variable to keep track of the current innermost call to // generate_while_statement(). + + char target[8]; + snprintf(target, 8, "ENDWH%d", root_while+nesting_level-1); + + JMP(target); + } // Recursively generate the given statement node, and all sub-statements.