Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
1020: Turn a few more assert!s that should never fire into debug_assert!s. r=nlewycky a=nlewycky

These are here to protect against errors when refactoring more than anything else.


Co-authored-by: Nick Lewycky <[email protected]>
  • Loading branch information
bors[bot] and nlewycky authored Nov 27, 2019
2 parents f6f8780 + 5a49fe7 commit dfc7163
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/llvm-backend/src/code.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1764,11 +1764,11 @@ impl FunctionCodeGenerator<CodegenError> for LLVMFunctionCodeGenerator {
let info = {
let mut info = i1.strip_pending() & i2.strip_pending();
if i1.has_pending_f32_nan() {
assert!(i2.has_pending_f32_nan());
debug_assert!(i2.has_pending_f32_nan());
info |= ExtraInfo::pending_f32_nan();
}
if i1.has_pending_f64_nan() {
assert!(i2.has_pending_f64_nan());
debug_assert!(i2.has_pending_f64_nan());
info |= ExtraInfo::pending_f64_nan();
}
info
Expand Down
4 changes: 2 additions & 2 deletions lib/llvm-backend/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,12 +163,12 @@ impl BitAnd for ExtraInfo {
type Output = Self;
fn bitand(self, other: Self) -> Self {
// Pending canonicalizations are not safe to discard, or even reorder.
assert!(
debug_assert!(
self.has_pending_f32_nan() == other.has_pending_f32_nan()
|| self.is_arithmetic_f32()
|| other.is_arithmetic_f32()
);
assert!(
debug_assert!(
self.has_pending_f64_nan() == other.has_pending_f64_nan()
|| self.is_arithmetic_f64()
|| other.is_arithmetic_f64()
Expand Down

0 comments on commit dfc7163

Please sign in to comment.