Skip to content

Commit

Permalink
Fix give-up case in ModulusRemainder (#8221)
Browse files Browse the repository at this point in the history
A default-constructed ModulusRemainder means no information, which is
what we want here. ModulusRemainder{0, 1} means the constant one!
  • Loading branch information
abadams authored May 15, 2024
1 parent 211bafa commit 16d77e9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ModulusRemainder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ ModulusRemainder ModulusRemainder::unify(const ModulusRemainder &a, const Modulu
int64_t r;
if (!sub_with_overflow(64, a.remainder, b.remainder, &r)) {
// The modulus is not representable as an int64.
return {0, 1};
return ModulusRemainder{};
}

int64_t diff = a.remainder - b.remainder;
Expand Down

0 comments on commit 16d77e9

Please sign in to comment.