ZJIT: Panic unimplemented for OOB basic block args (#13533)

This commit is contained in:
Shannon Skipper 2025-06-05 16:37:01 -07:00 committed by GitHub
parent 5da3dc88d6
commit 43472a3001
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
Notes: git 2025-06-05 23:37:15 +00:00
Merged-By: k0kubun <takashikkbn@gmail.com>

View File

@ -713,6 +713,12 @@ fn gen_save_sp(asm: &mut Assembler, stack_size: usize) {
fn param_reg(idx: usize) -> Reg {
// To simplify the implementation, allocate a fixed register for each basic block argument for now.
// TODO: Allow allocating arbitrary registers for basic block arguments
if idx >= ALLOC_REGS.len() {
unimplemented!(
"register spilling not yet implemented, too many basic block arguments ({}/{})",
idx + 1, ALLOC_REGS.len()
);
}
ALLOC_REGS[idx]
}