Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: SIGFPE crash
- X-seq: zsh-workers 29179
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: Jon Mayo <jon.mayo@xxxxxxxxx>
- Subject: Re: SIGFPE crash
- Date: Sun, 8 May 2011 00:17:23 +0200
- Cc: zsh workers <zsh-workers@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=1R+nieO3oVideGib3gUdlC4Mzs2+PDiNsyRdu9ijkSM=; b=Y4bwiFc55hVHw+19G2e6WBQVwmt2h/zLorlbKFhnCRUbwE4GDONOAdVzFibu06+xDa Cs5fyNkNSRPaoNyQ8sxyc/N9kdyySNm7cvIMNeuAU4hO+4q1mq/XOcWp0CVcXnhE2+oU 31yhR8NgvPXxKtk7Ut82RcpMLd4CuncWxc/vI=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=q+59QmyDap3GuEVMnW1Wum2lwX6Th9LQPPiZau0rbHpy7nt4Q4vlfPGoaicPNaBJb1 FXjvASh1gnQaK4taJ/EwijgQmd45q1o78WDCw8xZC7pNocZpiSDyAT/ibesPHMRL1ivi u3xUfyP6TeN9WmVQ6lQQ5JFN1yaujjs+uSoxA=
- In-reply-to: <BANLkTi=x2Cn3dZFGaEdVUm9+4mAse+dQsQ@mail.gmail.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <BANLkTi=x2Cn3dZFGaEdVUm9+4mAse+dQsQ@mail.gmail.com>
On 7 May 2011 23:56, Jon Mayo <jon.mayo@xxxxxxxxx> wrote:
> echo $[-9223372036854775808/-1]
>
> this causes zsh to exit immediately with an FPE. Does anyone have a
> patch to fix this?
diff --git a/Src/math.c b/Src/math.c
index 35b362d..3c08052 100644
--- a/Src/math.c
+++ b/Src/math.c
@@ -1053,8 +1053,12 @@ op(int what)
return;
if (c.type == MN_FLOAT)
c.u.d = a.u.d / b.u.d;
- else
- c.u.l = a.u.l / b.u.l;
+ else {
+ if (a.u.l == LONG_MIN && b.u.l == -1)
+ c.u.l = 0;
+ else
+ c.u.l = a.u.l / b.u.l;
+ }
break;
case MOD:
case MODEQ:
Do we want to print a warning and/or use another value than 0 in this case?
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author