mirror of
https://github.com/mii443/wasmer.git
synced 2025-12-06 12:48:20 +00:00
Get spectests passing with compiler-cranelift with hacks
This commit is contained in:
15
lib/api/src/externals/table.rs
vendored
15
lib/api/src/externals/table.rs
vendored
@@ -97,18 +97,9 @@ impl Table {
|
||||
/// Returns an error if the `delta` is out of bounds for the table.
|
||||
pub fn grow(&self, delta: u32, init: Val) -> Result<u32, RuntimeError> {
|
||||
let item = init.into_table_reference(&self.store)?;
|
||||
match self.table.grow(delta) {
|
||||
Some(len) => {
|
||||
for i in 0..delta {
|
||||
set_table_item(self.table.as_ref(), len + i, item.clone())?;
|
||||
}
|
||||
Ok(len)
|
||||
}
|
||||
None => Err(RuntimeError::new(format!(
|
||||
"failed to grow table by `{}`",
|
||||
delta
|
||||
))),
|
||||
}
|
||||
self.table
|
||||
.grow(delta, item)
|
||||
.ok_or_else(|| RuntimeError::new(format!("failed to grow table by `{}`", delta)))
|
||||
}
|
||||
|
||||
/// Copies the `len` elements of `src_table` starting at `src_index`
|
||||
|
||||
Reference in New Issue
Block a user