Skip to content

Commit

Permalink
prevent reg overriding after creating array
Browse files Browse the repository at this point in the history
  • Loading branch information
glyh committed Nov 7, 2024
1 parent e9545af commit 7071ab2
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/riscv/codegen.mbt
Original file line number Diff line number Diff line change
Expand Up @@ -943,10 +943,7 @@ fn CodegenBlock::codegen(self : CodegenBlock) -> Unit {
// 2. prepare regs for continuation. A0 is already the array
self.resolve_loop([(continuation, I(A1))])
// 3. Generate the call to continuation
let cont_reg = self.pull_val_i(continuation)
self.insert_asms(
[Ld(cont_reg, { base: cont_reg, offset: 0 }), Jr(cont_reg)],
)
self.insert_asms([Ld(reg_swap, { base: A1, offset: 0 }), Jr(reg_swap)])
}
Call(f, args) => {
// 1. Fill in the params to regs
Expand Down

0 comments on commit 7071ab2

Please sign in to comment.