aboutsummaryrefslogtreecommitdiff
path: root/gdb/valarith.c
diff options
context:
space:
mode:
authorDoug Evans <dje@google.com>2008-02-03 01:51:04 +0000
committerDoug Evans <dje@google.com>2008-02-03 01:51:04 +0000
commitf8597ac33d9715761645b4308e401e4c5c94e5db (patch)
tree6126f528c43ba6d3dcb5bd02697b7b27e5c33d9e /gdb/valarith.c
parent41808ebe9d27c94bf0169ea7dbfea495cc4c6d86 (diff)
downloadgdb-f8597ac33d9715761645b4308e401e4c5c94e5db.zip
gdb-f8597ac33d9715761645b4308e401e4c5c94e5db.tar.gz
gdb-f8597ac33d9715761645b4308e401e4c5c94e5db.tar.bz2
* valarith.c (value_binop): Handle unsigned BINOP_REM division by zero.
Diffstat (limited to 'gdb/valarith.c')
-rw-r--r--gdb/valarith.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gdb/valarith.c b/gdb/valarith.c
index e69aaa6..6205912 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: