diff --git a/docs/middle-ir-gen.md b/docs/middle-ir-gen.md index d73fcd7..a134c6a 100644 --- a/docs/middle-ir-gen.md +++ b/docs/middle-ir-gen.md @@ -841,8 +841,8 @@ class="sourceCode c">body_bb = new_label() exit_bb = new_label() // entry block of While should be separated. -create_jump(entry_bb, basic_block); -cond_value = translate_expr(Expr, sym_table, current_bb); +create_jump(entry_bb, current_bb); +cond_value = translate_expr(Expr, sym_table, entry_bb); create_branch(cond, body_bb, exit_bb, entry_bb); body_exit_bb = translate_stmt(Stmt, sym_table, body_bb);