feat(vm): add call stack depth guard to MirInterpreter
This commit is contained in:
@ -41,6 +41,9 @@ pub struct MirInterpreter {
|
||||
pub(super) inst_count: u64,
|
||||
pub(super) branch_count: u64,
|
||||
pub(super) compare_count: u64,
|
||||
/// Call stack depth (exec_function_inner nesting). Used as a safety valve
|
||||
/// to prevent Rust stack overflow on accidental infinite recursion in MIR.
|
||||
pub(super) call_depth: usize,
|
||||
}
|
||||
|
||||
impl MirInterpreter {
|
||||
@ -58,6 +61,7 @@ impl MirInterpreter {
|
||||
inst_count: 0,
|
||||
branch_count: 0,
|
||||
compare_count: 0,
|
||||
call_depth: 0,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user