aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
authorterra@gnome.org <terra@gnome.org>2004-08-04 10:09:01 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-07 21:02:36 -0700
commitde5ea81679660d0545968a602fcc9d01d4d076b5 (patch)
treecf1f503d0c46d3ece4702e974446785b01370789
parentf439331f2501667d6ff553208010d44034c924f6 (diff)
downloadsparse-dev-de5ea81679660d0545968a602fcc9d01d4d076b5.tar.gz
[PATCH] simplify_float_binop
Another case of prematurely loading floating point values.
-rw-r--r--expand.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/expand.c b/expand.c
index 9fbcad81..4e516f80 100644
--- a/expand.c
+++ b/expand.c
@@ -274,12 +274,14 @@ static int simplify_float_binop(struct expression *expr)
{
struct expression *left = expr->left, *right = expr->right;
unsigned long mod = expr->ctype->ctype.modifiers;
- long double l = left->fvalue;
- long double r = right->fvalue;
- long double res;
+ long double l, r, res;
if (left->type != EXPR_FVALUE || right->type != EXPR_FVALUE)
return 0;
+
+ l = left->fvalue;
+ r = right->fvalue;
+
if (mod & MOD_LONGLONG) {
switch (expr->op) {
case '+': res = l + r; break;