From: "Doug Evans" <dje@google.com>
To: "GDB Patches" <gdb-patches@sourceware.org>
Subject: [RFA] handle value_binop BINOP_REM division by zero
Date: Wed, 30 Jan 2008 16:53:00 -0000 [thread overview]
Message-ID: <e394668d0801300844h8d950acsc1f488898eca9c14@mail.gmail.com> (raw)
Unsigned division by zero got patched but not BINOP_REM.
Ok to check in?
2008-01-30 Doug Evans <dje@google.com>
* valarith.c (value_binop): Handle BINOP_REM division by zero.
Index: valarith.c
===================================================================
RCS file: /cvs/src/src/gdb/valarith.c,v
retrieving revision 1.56
diff -u -p -r1.56 valarith.c
--- valarith.c 30 Jan 2008 07:28:16 -0000 1.56
+++ valarith.c 30 Jan 2008 16:40:26 -0000
@@ -1116,7 +1116,10 @@ value_binop (struct value *arg1, struct
break;
case BINOP_REM:
- v = v1 % v2;
+ if (v2 !=0)
+ v = v1 % v2;
+ else
+ error (_("Division by zero"));
break;
case BINOP_MOD:
next reply other threads:[~2008-01-30 16:45 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-30 16:53 Doug Evans [this message]
2008-01-30 17:18 ` Daniel Jacobowitz
2008-01-30 17:46 ` Doug Evans
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e394668d0801300844h8d950acsc1f488898eca9c14@mail.gmail.com \
--to=dje@google.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox