Fix If emit

This commit is contained in:
Rerumu 2022-06-12 04:20:50 -04:00
parent a379fb2e91
commit ce9421d549
2 changed files with 1 additions and 11 deletions

View File

@ -129,8 +129,6 @@ impl Driver for Backward {
impl Driver for If { impl Driver for If {
fn write(&self, mng: &mut Manager, w: &mut dyn Write) -> Result<()> { fn write(&self, mng: &mut Manager, w: &mut dyn Write) -> Result<()> {
let label = mng.push_label();
write!(w, "if ")?; write!(w, "if ")?;
write_condition(&self.cond, mng, w)?; write_condition(&self.cond, mng, w)?;
write!(w, "then ")?; write!(w, "then ")?;
@ -144,9 +142,6 @@ impl Driver for If {
} }
write!(w, "end ")?; write!(w, "end ")?;
write!(w, "::continue_at_{label}::")?;
mng.pop_label();
Ok(()) Ok(())
} }

View File

@ -135,8 +135,6 @@ impl Driver for Backward {
impl Driver for If { impl Driver for If {
fn write(&self, mng: &mut Manager, w: &mut dyn Write) -> Result<()> { fn write(&self, mng: &mut Manager, w: &mut dyn Write) -> Result<()> {
let rem = mng.push_label(Label::If);
write!(w, "while true do ")?; write!(w, "while true do ")?;
write!(w, "if ")?; write!(w, "if ")?;
write_condition(&self.cond, mng, w)?; write_condition(&self.cond, mng, w)?;
@ -152,10 +150,7 @@ impl Driver for If {
write!(w, "end ")?; write!(w, "end ")?;
write!(w, "break ")?; write!(w, "break ")?;
write!(w, "end ")?; write!(w, "end ")
mng.pop_label();
write_br_gadget(mng.label_list(), rem, w)
} }
} }