1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
use crate;
use crate;
/// Retrieves a mutable reference to the last `StackFrame` in the provided `StackFrames`.
///
/// # Arguments
/// * `stack_frames` - A mutable reference to the `StackFrames` collection.
///
/// # Returns
/// * `Ok(&mut StackFrame)` - A mutable reference to the last `StackFrame` if it exists.
/// * `Err(Error)` - An error if the `StackFrames` collection is empty.
///
/// # Errors
/// Returns an execution error with the message "No stack frame"
/// if the `StackFrames` collection is empty.
pub
/// Performs storing current program counter (PC) to the exception program counter (ex_pc) in the last `StackFrame`.
///
/// # Arguments
/// * `stack_frames` - A mutable reference to the `StackFrames` collection.
///
/// # Returns
/// * `Ok(())` - If the operation is successful.
/// * `Err(Error)` - If there is no `StackFrame` in the `StackFrames` collection.
///
/// # Errors
/// Propagates the error from `last_frame_mut` if the `StackFrames` collection is empty.
pub