Skip to content

Commit 0ae8b08

Browse files
committed
Fix bad merge
1 parent 7865718 commit 0ae8b08

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

crates/vm/src/frame.rs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1413,8 +1413,21 @@ impl ExecutingFrame<'_> {
14131413
self.execute_call(args, vm)
14141414
}
14151415
Instruction::CallKw { argc } => {
1416+
let nargs = argc.get(arg);
1417+
let instr_idx = self.lasti() as usize - 1;
1418+
let cache_base = instr_idx + 1;
1419+
let counter = self.code.instructions.read_cache_u16(cache_base);
1420+
if counter > 0 {
1421+
unsafe {
1422+
self.code
1423+
.instructions
1424+
.write_cache_u16(cache_base, counter - 1);
1425+
}
1426+
} else {
1427+
self.specialize_call_kw(vm, nargs, instr_idx, cache_base);
1428+
}
14161429
// Stack: [callable, self_or_null, arg1, ..., argN, kwarg_names]
1417-
let args = self.collect_keyword_args(argc.get(arg));
1430+
let args = self.collect_keyword_args(nargs);
14181431
self.execute_call(args, vm)
14191432
}
14201433
Instruction::CallFunctionEx => {

0 commit comments

Comments
 (0)