summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOtto Moerbeek <otto@cvs.openbsd.org>2007-11-03 18:55:38 +0000
committerOtto Moerbeek <otto@cvs.openbsd.org>2007-11-03 18:55:38 +0000
commit0c68de5a9eaaa31381b79595d4441f63aa3db9fd (patch)
tree58e90862777169f2f5ce5e6042ff10b24eeb5432
parent7a4d09ce15c9975da450adcc63785a6e9e1d485f (diff)
fix fp div by zero in a target dependent way; problem reported by
Chris Kuethe; ok ragge@
-rw-r--r--usr.bin/pcc/ccom/trees.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/pcc/ccom/trees.c b/usr.bin/pcc/ccom/trees.c
index e1940378090..d14ec5639bb 100644
--- a/usr.bin/pcc/ccom/trees.c
+++ b/usr.bin/pcc/ccom/trees.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trees.c,v 1.5 2007/10/20 18:24:11 otto Exp $ */
+/* $OpenBSD: trees.c,v 1.6 2007/11/03 18:55:37 otto Exp $ */
/*
* Copyright (c) 2003 Anders Magnusson (ragge@ludd.luth.se).
* All rights reserved.
@@ -227,7 +227,7 @@ buildtree(int o, NODE *l, NODE *r)
l->n_dcon *= r->n_dcon; break;
case DIV:
if (r->n_dcon == 0)
- uerror("division by 0.");
+ goto runtime;
else
l->n_dcon /= r->n_dcon;
}
@@ -238,7 +238,7 @@ buildtree(int o, NODE *l, NODE *r)
return(l);
}
}
-
+runtime:
/* its real; we must make a new node */
p = block(o, l, r, INT, 0, MKSUE(INT));