quality baseline
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
use crate::call_frame::CallFrame;
|
||||
use prometeu_bytecode::{TrapInfo, TRAP_INVALID_LOCAL};
|
||||
use prometeu_bytecode::FunctionMeta;
|
||||
use prometeu_bytecode::{TRAP_INVALID_LOCAL, TrapInfo};
|
||||
|
||||
/// Computes the absolute stack index for the start of the current frame's locals (including args).
|
||||
pub fn local_base(frame: &CallFrame) -> usize {
|
||||
@@ -14,7 +14,12 @@ pub fn local_index(frame: &CallFrame, slot: u32) -> usize {
|
||||
|
||||
/// Validates that a local slot index is within the valid range for the function.
|
||||
/// Range: 0 <= slot < (param_slots + local_slots)
|
||||
pub fn check_local_slot(meta: &FunctionMeta, slot: u32, opcode: u16, pc: u32) -> Result<(), TrapInfo> {
|
||||
pub fn check_local_slot(
|
||||
meta: &FunctionMeta,
|
||||
slot: u32,
|
||||
opcode: u16,
|
||||
pc: u32,
|
||||
) -> Result<(), TrapInfo> {
|
||||
let limit = meta.param_slots as u32 + meta.local_slots as u32;
|
||||
if slot < limit {
|
||||
Ok(())
|
||||
|
||||
Reference in New Issue
Block a user