Skip to content

Commit

Permalink
PR Comments
Browse files Browse the repository at this point in the history
  • Loading branch information
danielsn committed Feb 3, 2022
1 parent 5e541e2 commit e380232
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/kani-compiler/cbmc/src/goto_program/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -855,7 +855,7 @@ impl Expr {
// While one can technically use these on pointers, the result is treated as an integer.
// This is almost never what you actually want.
OverflowMinus | OverflowMult | OverflowPlus => {
lhs.typ.is_integer() && rhs.typ.is_integer()
lhs.typ == rhs.typ && lhs.typ.is_integer()
}
}
}
Expand Down Expand Up @@ -1206,7 +1206,7 @@ impl Expr {
// FIXME: https://github.com/model-checking/kani/issues/786
// Overflow checking on pointers is hard to do at the IREP level.
// Instead, we rely on `--pointer-overflow-check` in CBMC.
let overflowed = if self.typ.is_pointer() {
let overflowed = if self.typ.is_pointer() || e.typ.is_pointer() {
warn!(
"Overflow operations are not properly supported on pointer types {:?} {:?}",
self, e
Expand Down

0 comments on commit e380232

Please sign in to comment.