From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25157 invoked by alias); 30 Jan 2008 16:45:00 -0000 Received: (qmail 25149 invoked by uid 22791); 30 Jan 2008 16:44:59 -0000 X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.33.17) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 30 Jan 2008 16:44:42 +0000 Received: from zps37.corp.google.com (zps37.corp.google.com [172.25.146.37]) by smtp-out.google.com with ESMTP id m0UGiafh006054 for ; Wed, 30 Jan 2008 16:44:37 GMT Received: from wa-out-1112.google.com (wafm16.prod.google.com [10.114.189.16]) by zps37.corp.google.com with ESMTP id m0UGhRxg013161 for ; Wed, 30 Jan 2008 08:44:36 -0800 Received: by wa-out-1112.google.com with SMTP id m16so613748waf.14 for ; Wed, 30 Jan 2008 08:44:36 -0800 (PST) Received: by 10.115.54.1 with SMTP id g1mr1070899wak.132.1201711475939; Wed, 30 Jan 2008 08:44:35 -0800 (PST) Received: by 10.115.107.7 with HTTP; Wed, 30 Jan 2008 08:44:35 -0800 (PST) Message-ID: Date: Wed, 30 Jan 2008 16:53:00 -0000 From: "Doug Evans" To: "GDB Patches" Subject: [RFA] handle value_binop BINOP_REM division by zero MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-01/txt/msg00800.txt.bz2 Unsigned division by zero got patched but not BINOP_REM. Ok to check in? 2008-01-30 Doug Evans * 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: