Skip to content

Commit cf2a975

Browse files
committed
Port to main.
1 parent 3da5aac commit cf2a975

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

pulley/src/interp.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,11 @@ impl Vm {
182182
self.state.fp
183183
}
184184

185+
/// Returns the current `sp` register value.
186+
pub fn sp(&self) -> *mut u8 {
187+
self.state.sp
188+
}
189+
185190
/// Returns the current `lr` register value.
186191
pub fn lr(&self) -> *mut u8 {
187192
self.state.lr
@@ -578,6 +583,7 @@ pub struct MachineState {
578583
f_regs: [FRegVal; FReg::RANGE.end as usize],
579584
v_regs: [VRegVal; VReg::RANGE.end as usize],
580585
fp: *mut u8,
586+
sp: *mut u8,
581587
lr: *mut u8,
582588
stack: Vec<u8>,
583589
done_reason: Option<DoneReason<()>>,
@@ -595,6 +601,7 @@ impl fmt::Debug for MachineState {
595601
stack: _,
596602
done_reason: _,
597603
fp: _,
604+
sp: _,
598605
lr: _,
599606
} = self;
600607

@@ -676,6 +683,7 @@ impl MachineState {
676683
stack,
677684
done_reason: None,
678685
fp: HOST_RETURN_ADDR,
686+
sp: HOST_RETURN_ADDR,
679687
lr: HOST_RETURN_ADDR,
680688
};
681689

0 commit comments

Comments
 (0)