Skip to content

Commit

Permalink
fix: output module path in ABI
Browse files Browse the repository at this point in the history
  • Loading branch information
Wodann committed May 8, 2023
1 parent 2a28ee7 commit eba2c2e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions crates/mun_codegen/src/code_gen/assembly_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
3 changes: 2 additions & 1 deletion crates/mun_codegen/src/code_gen/symbols/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<mun_hir::Function>,
type_definitions: &HashSet<mun_hir::Ty>,
dispatch_table: &DispatchTable<'ink>,
Expand Down Expand Up @@ -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),
Expand Down
2 changes: 1 addition & 1 deletion crates/mun_codegen/tests/abi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ fn test_abi_compatibility() {
@r###"
AssemblyInfo(
symbols: ModuleInfo(
path: "",
path: "mod",
functions: [
FunctionDefinition(
prototype: FunctionPrototype(
Expand Down

0 comments on commit eba2c2e

Please sign in to comment.