From: Doug Evans Date: Sun, 3 Feb 2008 01:51:04 +0000 (+0000) Subject: * valarith.c (value_binop): Handle unsigned BINOP_REM division by zero. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f8597ac33d9715761645b4308e401e4c5c94e5db;p=binutils-gdb.git * valarith.c (value_binop): Handle unsigned BINOP_REM division by zero. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 7f90ef2e0ef..a05058c1833 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,7 @@ 2008-02-02 Doug Evans + * valarith.c (value_binop): Handle unsigned BINOP_REM division by zero. + * typeprint.c (*): Whitespace cleanup. 2008-02-02 Mark Kettenis diff --git a/gdb/valarith.c b/gdb/valarith.c index e69aaa67567..62059122c07 100644 --- a/gdb/valarith.c +++ b/gdb/valarith.c @@ -1116,7 +1116,10 @@ value_binop (struct value *arg1, struct value *arg2, enum exp_opcode op) break; case BINOP_REM: - v = v1 % v2; + if (v2 != 0) + v = v1 % v2; + else + error (_("Division by zero")); break; case BINOP_MOD: