Skip to content

Commit

Permalink
SH: catch negative denormal_subf1() retval in denormal_add()
Browse files Browse the repository at this point in the history
'ix' is unsigned but denormal_subf1() may return a negative int.

Signed-off-by: Roel Kluin <12o3l@tiscali.nl>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
  • Loading branch information
Roel Kluin authored and Paul Mundt committed May 9, 2008
1 parent cdf7da8 commit 9731e28
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/sh/kernel/cpu/sh2a/fpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ static int denormal_addf(int hx, int hy)
iy = hy & 0x7fffffff;
if (iy < 0x00800000) {
ix = denormal_subf1(ix, iy);
if (ix < 0) {
if ((int) ix < 0) {
ix = -ix;
sign ^= 0x80000000;
}
Expand Down Expand Up @@ -385,7 +385,7 @@ static long long denormal_addd(long long hx, long long hy)
iy = hy & 0x7fffffffffffffffLL;
if (iy < 0x0010000000000000LL) {
ix = denormal_subd1(ix, iy);
if (ix < 0) {
if ((int) ix < 0) {
ix = -ix;
sign ^= 0x8000000000000000LL;
}
Expand Down

0 comments on commit 9731e28

Please sign in to comment.