Skip to content

Commit

Permalink
AK: Make checked division also check for divide by zero
Browse files Browse the repository at this point in the history
  • Loading branch information
alimpfard committed Jun 2, 2021
1 parent 9a1853c commit 6cd9906
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions AK/Checked.h
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,10 @@ class Checked {
return;
}
}
if (other == 0) {
m_overflow = true;
return;
}
m_value /= other;
}

Expand Down

0 comments on commit 6cd9906

Please sign in to comment.