Fully qualify values exported to host linking

Previously we were only handing off exposed values based on their
inner-module ID, but actually the fully-resolved ID is needed, because
it's reasonable that two identical names from different modules are
exposed to the host.

Closes #3483
This commit is contained in:
Ayaz Hafiz 2022-07-13 08:42:46 -04:00
parent f9a5113210
commit 7ef03440ef
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58

View file

@ -114,14 +114,26 @@ pub fn build_file<'a>(
.exposed_to_host .exposed_to_host
.values .values
.keys() .keys()
.map(|x| x.as_str(&loaded.interns).to_string()) .map(|x| {
format!(
"{}.{}",
x.module_string(&loaded.interns),
x.as_str(&loaded.interns)
)
})
.collect(); .collect();
let exposed_closure_types = loaded let exposed_closure_types = loaded
.exposed_to_host .exposed_to_host
.closure_types .closure_types
.iter() .iter()
.map(|x| x.as_str(&loaded.interns).to_string()) .map(|x| {
format!(
"{}.{}",
x.module_string(&loaded.interns),
x.as_str(&loaded.interns)
)
})
.collect(); .collect();
let preprocessed_host_path = if emit_wasm { let preprocessed_host_path = if emit_wasm {