We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5e6754c commit a953409Copy full SHA for a953409
crates/wasmi/src/engine/executor/handler/state.rs
@@ -222,14 +222,16 @@ pub struct Sp {
222
impl Sp {
223
pub fn new(cells: &mut Vec<UntypedVal>, start: usize) -> Self {
224
debug_assert!(
225
- start < cells.len(),
+ // Note: it is fine to use <= here because for zero sized frames
226
+ // we sometimes end up with `start == cells.len()` which isn't
227
+ // bad since in those cases `Sp` is never used.
228
+ start <= cells.len(),
229
"start = {}, cells.len() = {}",
230
start,
231
cells.len()
232
);
- Self {
- value: unsafe { cells.as_mut_ptr().add(start) },
- }
233
+ let value = unsafe { cells.as_mut_ptr().add(start) };
234
+ Self { value }
235
}
236
237
pub fn dangling() -> Self {
0 commit comments