Skip to content

Commit a986d55

Browse files
committed
fix
1 parent 897fa23 commit a986d55

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

crates/jit/tests/common.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use core::ops::ControlFlow;
22
use rustpython_compiler_core::bytecode::{
3-
CodeObject, ConstantData, Instruction, OpArg, OpArgState,
3+
CodeObject, ConstantData, Constants, Instruction, OpArg, OpArgState,
44
};
55
use rustpython_jit::{CompiledCode, JitType};
66
use rustpython_wtf8::{Wtf8, Wtf8Buf};
@@ -99,7 +99,8 @@ fn extract_annotations_from_annotate_code(code: &CodeObject) -> HashMap<Wtf8Buf,
9999

100100
// Key should be a const string (parameter name)
101101
if key_is_const
102-
&& let ConstantData::Str { value } = &code.constants[key_idx]
102+
&& let ConstantData::Str { value } =
103+
&code.constants[(key_idx as u32).into()]
103104
{
104105
let param_name = value;
105106
// Value can be a name (type ref) or a const string (forward ref)
@@ -185,7 +186,7 @@ impl StackMachine {
185186
&mut self,
186187
instruction: Instruction,
187188
arg: OpArg,
188-
constants: &[ConstantData],
189+
constants: &Constants,
189190
names: &[String],
190191
) -> ControlFlow<()> {
191192
match instruction {

0 commit comments

Comments
 (0)