From 9e48c3b9a6540d600072f8d0739d134beb7cdffc Mon Sep 17 00:00:00 2001 From: Jeff Walden Date: Thu, 19 Mar 2009 15:05:48 -0700 Subject: [PATCH] Bug 483956 - gcc 4.4 warnings about "may be undefined" operations. r=gal --- js/src/jstracer.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/js/src/jstracer.cpp b/js/src/jstracer.cpp index 22e8208ec2f..52ce41c0832 100644 --- a/js/src/jstracer.cpp +++ b/js/src/jstracer.cpp @@ -634,16 +634,22 @@ static LIns* demote(LirWriter *out, LInsp i) static bool isPromoteInt(LIns* i) { - jsdouble d; - return isi2f(i) || i->isconst() || - (i->isconstq() && (d = i->constvalf()) == jsdouble(jsint(d)) && !JSDOUBLE_IS_NEGZERO(d)); + if (isi2f(i) || i->isconst()) + return true; + if (!i->isconstq()) + return false; + jsdouble d = i->constvalf(); + return d == jsdouble(jsint(d)) && !JSDOUBLE_IS_NEGZERO(d); } static bool isPromoteUint(LIns* i) { - jsdouble d; - return isu2f(i) || i->isconst() || - (i->isconstq() && (d = i->constvalf()) == (jsdouble)(jsuint)d && !JSDOUBLE_IS_NEGZERO(d)); + if (isu2f(i) || i->isconst()) + return true; + if (!i->isconstq()) + return false; + jsdouble d = i->constvalf(); + return d == jsdouble(jsuint(d)) && !JSDOUBLE_IS_NEGZERO(d); } static bool isPromote(LIns* i)