* valarith.c (value_binop): Handle unsigned BINOP_REM division by zero.

This commit is contained in:
Doug Evans 2008-02-03 01:51:04 +00:00
parent 41808ebe9d
commit f8597ac33d
2 changed files with 6 additions and 1 deletions

View File

@ -1,5 +1,7 @@
2008-02-02 Doug Evans <dje@google.com>
* valarith.c (value_binop): Handle unsigned BINOP_REM division by zero.
* typeprint.c (*): Whitespace cleanup.
2008-02-02 Mark Kettenis <kettenis@gnu.org>

View File

@ -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: