Skip to content

Commit

Permalink
correct root function export/import for smoke test in symmetric
Browse files Browse the repository at this point in the history
  • Loading branch information
cpetig committed Aug 31, 2024
1 parent 3d79f54 commit e724874
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions crates/core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -485,12 +485,16 @@ pub fn make_external_component(input: &str) -> String {

/// encode symbol as alphanumeric by hex-encoding special characters
pub fn make_external_symbol(module_name: &str, name: &str, variant: abi::AbiVariant) -> String {
let mut res = make_external_component(module_name);
res.push_str(if matches!(variant, abi::AbiVariant::GuestExport) {
"X23" // Hash character
if module_name.is_empty() || module_name=="$root" {
make_external_component(name)
} else {
"X00" // NUL character (some tools use '.' for display)
});
res.push_str(&make_external_component(name));
res
let mut res = make_external_component(module_name);
res.push_str(if matches!(variant, abi::AbiVariant::GuestExport) {
"X23" // Hash character
} else {
"X00" // NUL character (some tools use '.' for display)
});
res.push_str(&make_external_component(name));
res
}
}

0 comments on commit e724874

Please sign in to comment.