Skip to content

Commit 8215dcf

Browse files
fixes
1 parent 86da2a0 commit 8215dcf

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/ir/verifier.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ impl FunctionIRVerifier<'_> {
3535
Instr::LoadConst { dst, .. } => {
3636
self.verify_temp_def(*dst)
3737
}
38-
Instr::Binary { dst, lhs, rhs, .. } {
38+
Instr::Binary { dst, lhs, rhs, .. } => {
3939
self.verify_temp(*lhs);
4040
self.verify_temp(*rhs);
4141
self.verify_temp_def(*dst);
@@ -47,12 +47,12 @@ impl FunctionIRVerifier<'_> {
4747
}
4848

4949
match place {
50-
Place::Local(id) => self.ir.locals.len() > id.index(),
50+
Place::Local(id) => self.ir.locals.len() > id.index() as usize,
5151
};
5252
}
5353
Instr::Load { dst, place } => {
5454
match place {
55-
Place::Local(id) => self.ir.locals.len() > id.index(),
55+
Place::Local(id) => self.ir.locals.len() > id.index() as usize,
5656
};
5757
self.verify_temp_def(dst)
5858
}
@@ -66,8 +66,8 @@ impl FunctionIRVerifier<'_> {
6666

6767
fn verify_terminator(&self, term: &Terminator) {
6868
match term {
69-
Goto(id) => { self.ir.blocks.len() > id.len(); },
70-
Return(Value::Temp(id)) => self.verify_temp(*id),
69+
Terminator::Goto(id) => { self.ir.blocks.len() > id.index() as usize; },
70+
Terminator::Return(Value::Temp(id)) => self.verify_temp(*id),
7171
_ => {}
7272
}
7373
}

0 commit comments

Comments
 (0)