Skip to content

Commit 571ac6b

Browse files
committed
fix jit tests
1 parent 5da656e commit 571ac6b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

crates/jit/tests/common.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ fn extract_annotations_from_annotate_code(code: &CodeObject) -> HashMap<Wtf8Buf,
7777

7878
match instruction {
7979
Instruction::LoadConst { consti } => {
80-
stack.push((true, consti.get(arg) as usize));
80+
stack.push((true, consti.get(arg).as_usize()));
8181
}
8282
Instruction::LoadName { namei } => {
8383
stack.push((false, namei.get(arg) as usize));
@@ -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)
@@ -193,8 +194,7 @@ impl StackMachine {
193194
// No-op for JIT tests
194195
}
195196
Instruction::LoadConst { consti } => {
196-
let idx = consti.get(arg);
197-
self.stack.push(constants[idx as usize].clone().into())
197+
self.stack.push(constants[consti.get(arg)].clone().into())
198198
}
199199
Instruction::LoadName { namei } => self
200200
.stack

0 commit comments

Comments
 (0)