Skip to content

Commit

Permalink
Fmt, fix 'check_fuzz' job by setting stack-end to None by default
Browse files Browse the repository at this point in the history
  • Loading branch information
techraed committed Jul 26, 2023
1 parent 275b9b2 commit 7db06ec
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 16 deletions.
31 changes: 18 additions & 13 deletions utils/wasm-gen/src/config/generator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ impl Default for MemoryPagesConfig {
Self {
initial_size: Self::MAX_VALUE / 2 + 1,
upper_limit: Some(Self::MAX_VALUE),
// Make value a multiple of WASM_PAGE_SIZE (bytes), but less than min memory.
stack_end: Some(WASM_PAGE_SIZE * Self::MAX_VALUE / 2),
stack_end: None,
}
}
}
Expand Down Expand Up @@ -113,27 +112,33 @@ pub enum EntryPointsSet {
impl EntryPointsSet {
/// Checks whether the set has ***init*** entry point.
pub fn has_init(&self) -> bool {
matches!(self, EntryPointsSet::Init
| EntryPointsSet::InitHandle
| EntryPointsSet::InitHandleReply
| EntryPointsSet::InitHandleHandleReply
matches!(
self,
EntryPointsSet::Init
| EntryPointsSet::InitHandle
| EntryPointsSet::InitHandleReply
| EntryPointsSet::InitHandleHandleReply
)
}

/// Checks whether the set has ***handle*** entry point.
pub fn has_handle(&self) -> bool {
matches!(self, EntryPointsSet::InitHandle
| EntryPointsSet::InitHandleHandleReply
| EntryPointsSet::Handle
| EntryPointsSet::HandleHandleReply
matches!(
self,
EntryPointsSet::InitHandle
| EntryPointsSet::InitHandleHandleReply
| EntryPointsSet::Handle
| EntryPointsSet::HandleHandleReply
)
}

/// Checks whether the set has ***handle_reply*** entry point.
pub fn has_handle_reply(&self) -> bool {
matches!(self, EntryPointsSet::InitHandleReply
| EntryPointsSet::InitHandleHandleReply
| EntryPointsSet::HandleHandleReply
matches!(
self,
EntryPointsSet::InitHandleReply
| EntryPointsSet::InitHandleHandleReply
| EntryPointsSet::HandleHandleReply
)
}
}
6 changes: 3 additions & 3 deletions utils/wasm-gen/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ impl<'a> WasmGen<'a> {
}

pub fn gen_handle(&mut self, module: Module) -> (Module, bool) {
if self.config.entry_points_config.has_handle() {
if !self.config.entry_points_config.has_handle() {
return (module, false);
}

Expand All @@ -479,7 +479,7 @@ impl<'a> WasmGen<'a> {
}

pub fn gen_handle_reply(&mut self, module: Module) -> (Module, bool) {
if self.config.entry_points_config.has_handle_reply() {
if !self.config.entry_points_config.has_handle_reply() {
return (module, false);
}

Expand All @@ -496,7 +496,7 @@ impl<'a> WasmGen<'a> {
}

pub fn gen_init(&mut self, module: Module) -> (Module, bool) {
if self.config.entry_points_config.has_init() {
if !self.config.entry_points_config.has_init() {
return (module, false);
}

Expand Down

0 comments on commit 7db06ec

Please sign in to comment.