Same as `set_sp` but does not check to see if `sp` is in-bounds. Should only be used with stack increment operations such as `pop`.
(&mut self, sp: *mut T)
| 1086 | /// Same as `set_sp` but does not check to see if `sp` is in-bounds. Should |
| 1087 | /// only be used with stack increment operations such as `pop`. |
| 1088 | fn set_sp_unchecked<T>(&mut self, sp: *mut T) { |
| 1089 | if cfg!(debug_assertions) { |
| 1090 | let sp_raw = sp as usize; |
| 1091 | let base = self.state.stack.base() as usize; |
| 1092 | let end = base + self.state.stack.len(); |
| 1093 | assert!(base <= sp_raw && sp_raw <= end); |
| 1094 | } |
| 1095 | self.state[XReg::sp].set_ptr(sp); |
| 1096 | } |
| 1097 | |
| 1098 | /// Loads a value of `T` using native-endian byte ordering from the `addr` |
| 1099 | /// specified. |