Skip to content

Commit

Permalink
Fixed 64bit arith exception (fixes #1122)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mitko Iliev authored and pkleef committed Apr 13, 2023
1 parent ea8b2c9 commit 25fff0e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions libsrc/Wi/sqlbif.c
Original file line number Diff line number Diff line change
Expand Up @@ -7404,6 +7404,9 @@ bif_mod (caddr_t * qst, caddr_t * err_ret, state_slot_t ** args)
sqlr_new_error ("22012", "SR046", "Division by zero in mod(" BOXINT_FMT "," BOXINT_FMT ")",
(boxint)long1, (boxint)long2);
}
if (long1 <= INT64_MIN)
sqlr_new_error ("22012", "SR046", "Out of range in mod(" BOXINT_FMT "," BOXINT_FMT ")",
(boxint)long1, (boxint)long2);

return (box_num (long1 % long2));
}
Expand Down

0 comments on commit 25fff0e

Please sign in to comment.