Skip to content

Commit 1f1dc2e

Browse files
committed
address review: check datastack space for extra_bytes, require CO_OPTIMIZED in vectorcall fast path
1 parent 7d27f06 commit 1f1dc2e

File tree

3 files changed

+2
-3
lines changed

3 files changed

+2
-3
lines changed

.cspell.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,6 @@
6060
"dedentations",
6161
"dedents",
6262
"deduped",
63-
"compactlong",
64-
"compactlongs",
6563
"deoptimize",
6664
"descrs",
6765
"downcastable",

crates/vm/src/builtins/function.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1374,6 +1374,7 @@ pub(crate) fn vectorcall_function(
13741374

13751375
let has_kwargs = kwnames.is_some_and(|kw| !kw.is_empty());
13761376
let is_simple = !has_kwargs
1377+
&& code.flags.contains(bytecode::CodeFlags::OPTIMIZED)
13771378
&& !code.flags.contains(bytecode::CodeFlags::VARARGS)
13781379
&& !code.flags.contains(bytecode::CodeFlags::VARKEYWORDS)
13791380
&& code.kwonlyarg_count == 0

crates/vm/src/frame.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8747,7 +8747,7 @@ impl ExecutingFrame<'_> {
87478747
Some(frame_size) => frame_size
87488748
.checked_add(extra_bytes)
87498749
.is_some_and(|size| vm.datastack_has_space(size)),
8750-
None => true,
8750+
None => extra_bytes == 0 || vm.datastack_has_space(extra_bytes),
87518751
}
87528752
}
87538753

0 commit comments

Comments
 (0)