diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/feature.def | 4 | ||||
-rw-r--r-- | src/opcode.cc | 2 | ||||
-rw-r--r-- | src/validator.cc | 4 |
3 files changed, 7 insertions, 3 deletions
diff --git a/src/feature.def b/src/feature.def index ee6d6c8d..a74918e1 100644 --- a/src/feature.def +++ b/src/feature.def @@ -23,6 +23,8 @@ * ========================================================================= */ WABT_FEATURE(exceptions, "exceptions", "Experimental exception handling") +WABT_FEATURE(mutable_globals, "mutable-globals", "Import/export mutable globals") WABT_FEATURE(sat_float_to_int, "saturating-float-to-int", "Saturating float-to-int operators") -WABT_FEATURE(threads, "threads", "Threading support") +WABT_FEATURE(sign_extension, "sign-extension", "Sign-extension operators") WABT_FEATURE(simd, "simd", "SIMD support") +WABT_FEATURE(threads, "threads", "Threading support") diff --git a/src/opcode.cc b/src/opcode.cc index a5f5aa75..280bb87e 100644 --- a/src/opcode.cc +++ b/src/opcode.cc @@ -112,6 +112,8 @@ bool Opcode::IsEnabled(const Features& features) const { case Opcode::I64Extend8S: case Opcode::I64Extend16S: case Opcode::I64Extend32S: + return features.sign_extension_enabled(); + case Opcode::AtomicWake: case Opcode::I32AtomicWait: case Opcode::I64AtomicWait: diff --git a/src/validator.cc b/src/validator.cc index 77fcabda..85715b47 100644 --- a/src/validator.cc +++ b/src/validator.cc @@ -892,7 +892,7 @@ void Validator::CheckImport(const Location* loc, const Import* import) { case ExternalKind::Global: { auto* global_import = cast<GlobalImport>(import); if (global_import->global.mutable_ && - !options_->features.threads_enabled()) { + !options_->features.mutable_globals_enabled()) { PrintError(loc, "mutable globals cannot be imported"); } ++num_imported_globals_; @@ -919,7 +919,7 @@ void Validator::CheckExport(const Location* loc, const Export* export_) { case ExternalKind::Global: { const Global* global; if (Succeeded(CheckGlobalVar(&export_->var, &global, nullptr))) { - if (global->mutable_ && !options_->features.threads_enabled()) { + if (global->mutable_ && !options_->features.mutable_globals_enabled()) { PrintError(&export_->var.loc, "mutable globals cannot be exported"); } } |