diff options
author | Shravan Narayan <shravanrn@gmail.com> | 2024-01-30 19:37:52 -0600 |
---|---|---|
committer | Shravan Narayan <shravanrn@gmail.com> | 2024-01-30 20:23:18 -0600 |
commit | 80b4f087aa65a7f23d3489f80eaa298a1cdb3913 (patch) | |
tree | 56d3c49897d6245dc670cf0591965db147b31e9b /src/binary-reader-ir.cc | |
parent | cb76e5cd81312e4dba52a06cfc6bc35f795e05bb (diff) | |
download | wabt-80b4f087aa65a7f23d3489f80eaa298a1cdb3913.tar.gz wabt-80b4f087aa65a7f23d3489f80eaa298a1cdb3913.tar.bz2 wabt-80b4f087aa65a7f23d3489f80eaa298a1cdb3913.zip |
wasm2c: atomic and shared mem operations using c11
Diffstat (limited to 'src/binary-reader-ir.cc')
-rw-r--r-- | src/binary-reader-ir.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/binary-reader-ir.cc b/src/binary-reader-ir.cc index 07546996..a918c39d 100644 --- a/src/binary-reader-ir.cc +++ b/src/binary-reader-ir.cc @@ -616,6 +616,9 @@ Result BinaryReaderIR::OnImportMemory(Index import_index, import->module_name = module_name; import->field_name = field_name; import->memory.page_limits = *page_limits; + if (import->memory.page_limits.is_shared) { + module_->features_used.threads = true; + } module_->AppendField( std::make_unique<ImportModuleField>(std::move(import), GetLocation())); return Result::Ok; @@ -697,6 +700,9 @@ Result BinaryReaderIR::OnMemory(Index index, const Limits* page_limits) { auto field = std::make_unique<MemoryModuleField>(GetLocation()); Memory& memory = field->memory; memory.page_limits = *page_limits; + if (memory.page_limits.is_shared) { + module_->features_used.threads = true; + } module_->AppendField(std::move(field)); return Result::Ok; } |