Fix logic for is_enabled in the threads transform (#1791)

The threads transform is implicitly enabled nowadays when the memory
looks like it's shared, so ensure that's taken into account in the
`is_enabled` check.
This commit is contained in:
Alex Crichton
2019-09-25 11:58:55 -05:00
committed by GitHub
parent f4a7fe3ddb
commit 6f52f2a37c
2 changed files with 17 additions and 14 deletions

View File

@ -283,7 +283,7 @@ impl Bindgen {
// pointer, so temporarily export it so that our many GC's don't remove
// it before the xform runs.
let mut exported_shadow_stack_pointer = false;
if self.multi_value || self.threads.is_enabled() {
if self.multi_value || self.threads.is_enabled(&module) {
wasm_conventions::export_shadow_stack_pointer(&mut module)?;
exported_shadow_stack_pointer = true;
}