fix: 修复变量过多导致寄存器溢出问题

This commit is contained in:
爱特每羊队
2026-06-06 18:53:37 +08:00
parent 65eb1aa9bb
commit a96b651feb
+1 -1
View File
@@ -81,7 +81,7 @@ impl CompileCtx {
pub(crate) fn alloc_reg(&mut self) -> u8 { pub(crate) fn alloc_reg(&mut self) -> u8 {
let r = self.next_reg; let r = self.next_reg;
self.next_reg += 1; self.next_reg = self.next_reg.wrapping_add(1);
if self.next_reg > self.max_regs { if self.next_reg > self.max_regs {
self.max_regs = self.next_reg; self.max_regs = self.next_reg;
} }