fix: LOAD_UPVALUE 的 uv_idx 改 Imm 编码避免被 RegAlloc 重写

This commit is contained in:
2026-08-07 16:09:17 +08:00
parent 66c952d2b2
commit fca660110d
+1 -1
View File
@@ -15,7 +15,7 @@ impl Emitter {
if up.name == name {
let r = ctx.alloc_reg();
let idx = uv_idx as u8;
ctx.inst(Inst::new(OpCode::LOAD_UPVALUE, Operand::Reg(r), Operand::Reg(idx as u32), Operand::None));
ctx.inst(Inst::new(OpCode::LOAD_UPVALUE, Operand::Reg(r), Operand::Imm(idx as u16), Operand::None));
return Ok(r);
}
}