Skip to content

Commit

Permalink
Feature wasm-opt
Browse files Browse the repository at this point in the history
  • Loading branch information
fxgst committed Jan 28, 2025
1 parent 41bb2f5 commit 1084328
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use std::borrow::Cow;
use std::collections::HashMap;
use std::io::{self, Read};
use walrus::*;
#[cfg(feature = "wasm-opt")]
use wasm_opt::Feature;
use wasmparser::{Validator, WasmFeaturesInflated};

Expand All @@ -14,6 +15,7 @@ pub const GZIPPED_WASM_MAGIC_BYTES: &[u8] = &[31, 139, 8];
// The feature set should be align with IC `wasmtime` validation config:
// https://github.com/dfinity/ic/blob/6a6470d705a0f36fb94743b12892280409f85688/rs/embedders/src/wasm_utils/validation.rs#L1385
// Since we use both wasm_opt::Feature and wasmparse::WasmFeature, we have to define the config/features for both.
#[cfg(feature = "wasm-opt")]
pub const IC_ENABLED_WASM_FEATURES: [Feature; 7] = [
Feature::MutableGlobals,
Feature::TruncSat,
Expand Down

0 comments on commit 1084328

Please sign in to comment.