Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions som-interpreter-bc/src/frame.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,8 @@ impl Frame {
#[inline(always)]
pub fn lookup_constant(&self, idx: usize) -> Literal {
match cfg!(debug_assertions) {
true => unsafe { (*self.literals).get(idx).unwrap().clone() },
false => unsafe { (*self.literals).get_unchecked(idx).clone() }
true => unsafe { (&(*self.literals)).get(idx).unwrap().clone() },
false => unsafe { (&(*self.literals)).get_unchecked(idx).clone() }
}
}

Expand Down
2 changes: 1 addition & 1 deletion som-interpreter-bc/src/interpreter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ impl Interpreter {
let frame = Rc::clone(&self.current_frame);

// Actually safe, there's always a reference to the current bytecodes. Need unsafe because we want to store a ref for quick access in perf-critical code
let bytecode = *(unsafe { (*self.current_bytecodes).get_unchecked(self.bytecode_idx) });
let bytecode = *(unsafe { (&(*self.current_bytecodes)).get_unchecked(self.bytecode_idx) });

self.bytecode_idx += 1;

Expand Down