diff --git a/crates/environ/src/fact.rs b/crates/environ/src/fact.rs index 4d35ee5ea602..70437996c996 100644 --- a/crates/environ/src/fact.rs +++ b/crates/environ/src/fact.rs @@ -262,7 +262,7 @@ impl<'a> Module<'a> { let memory = memory.as_ref().map(|memory| { self.import_memory( "memory", - "", + &format!("m{}", self.imported_memories.len()), MemoryType { minimum: 0, maximum: None, @@ -279,7 +279,12 @@ impl<'a> Module<'a> { ValType::I32 }; let ty = self.core_types.function(&[ptr, ptr, ptr, ptr], &[ptr]); - self.import_func("realloc", "", ty, func.clone()) + self.import_func( + "realloc", + &format!("f{}", self.imported_funcs.len()), + ty, + func.clone(), + ) }); AdapterOptions {