diff --git a/crates/mun_codegen/src/code_gen/assembly_builder.rs b/crates/mun_codegen/src/code_gen/assembly_builder.rs index 062e8f3dc..ad29f42e3 100644 --- a/crates/mun_codegen/src/code_gen/assembly_builder.rs +++ b/crates/mun_codegen/src/code_gen/assembly_builder.rs @@ -95,6 +95,7 @@ impl<'db, 'ink, 'ctx, 't> AssemblyBuilder<'db, 'ink, 'ctx, 't> { symbols::gen_reflection_ir( self.code_gen.db, &value_context, + &module_group.name, &file.function_definitions, &file.type_definitions, &group_ir.dispatch_table, diff --git a/crates/mun_codegen/src/code_gen/symbols/mod.rs b/crates/mun_codegen/src/code_gen/symbols/mod.rs index 45ec8254a..17f362ff8 100644 --- a/crates/mun_codegen/src/code_gen/symbols/mod.rs +++ b/crates/mun_codegen/src/code_gen/symbols/mod.rs @@ -341,6 +341,7 @@ fn gen_dispatch_table<'ink>( pub(super) fn gen_reflection_ir<'db, 'ink>( db: &'db dyn HirDatabase, context: &IrValueContext<'ink, '_, '_>, + module_name: &str, function_definitions: &HashSet, type_definitions: &HashSet, dispatch_table: &DispatchTable<'ink>, @@ -372,7 +373,7 @@ pub(super) fn gen_reflection_ir<'db, 'ink>( // Construct the module info struct let module_info = ir::ModuleInfo { - path: CString::new("") + path: CString::new(module_name) .unwrap() .intern("module_info::path", context) .as_value(context), diff --git a/crates/mun_codegen/tests/abi.rs b/crates/mun_codegen/tests/abi.rs index e1d988285..10990a670 100644 --- a/crates/mun_codegen/tests/abi.rs +++ b/crates/mun_codegen/tests/abi.rs @@ -32,7 +32,7 @@ fn test_abi_compatibility() { @r###" AssemblyInfo( symbols: ModuleInfo( - path: "", + path: "mod", functions: [ FunctionDefinition( prototype: FunctionPrototype(