MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / set_sp_unchecked

Method set_sp_unchecked

pulley/src/interp.rs:1088–1096  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.

Callers 4

popMethod · 0.80
set_spMethod · 0.80
pop_frameMethod · 0.80
stack_free32Method · 0.80

Calls 3

set_ptrMethod · 0.80
baseMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected