diff --git a/lib/frontend/src/ssa.rs b/lib/frontend/src/ssa.rs index 6ec44c5f7a..498b0b0ea3 100644 --- a/lib/frontend/src/ssa.rs +++ b/lib/frontend/src/ssa.rs @@ -119,7 +119,7 @@ struct EbbHeaderBlockData { pub struct Block(u32); impl EntityRef for Block { fn new(index: usize) -> Self { - assert!(index < (u32::MAX as usize)); + debug_assert!(index < (u32::MAX as usize)); Block(index as u32) } @@ -362,7 +362,7 @@ where let (undef_vars, ebb): (Vec<(Variable, Value)>, Ebb) = match self.blocks[block] { BlockData::EbbBody { .. } => panic!("this should not happen"), BlockData::EbbHeader(ref mut data) => { - assert!(!data.sealed); + debug_assert!(!data.sealed); // Extract the undef_variables data from the block so that we // can iterate over it without borrowing the whole builder. let mut undef_variables = Vec::new(); @@ -390,8 +390,8 @@ where match self.blocks[block] { BlockData::EbbBody { .. } => panic!("this should not happen"), BlockData::EbbHeader(ref mut data) => { - assert!(!data.sealed); - assert!(data.undef_variables.is_empty()); + debug_assert!(!data.sealed); + debug_assert!(data.undef_variables.is_empty()); data.sealed = true; } }; diff --git a/lib/wasm/src/translation_utils.rs b/lib/wasm/src/translation_utils.rs index 4a7f375bb8..d378864e5c 100644 --- a/lib/wasm/src/translation_utils.rs +++ b/lib/wasm/src/translation_utils.rs @@ -89,7 +89,7 @@ pub struct Memory { pub struct Local(pub u32); impl cretonne::entity::EntityRef for Local { fn new(index: usize) -> Self { - assert!(index < (u32::MAX as usize)); + debug_assert!(index < (u32::MAX as usize)); Local(index as u32) }