Skip to contentSkip to conversation

SH: catch negative denormal_subf1() retval in denormal_add()

PATCH In review Roel Kluin 2 participants 2 messages Apr 17, 2008 – May 9, 2008 SuperH

lore
Share & tools
lore

Roel Kluin

author
#0 lore raw

PATCH 1/1 SH: catch negative denormal_subf1() retval in denormal_add()

'ix' is unsigned but denormal_subf1() may return a negative int.

---

arch/sh/kernel/cpu/sh2a/fpu.c +2 -2
index 5627c0b..6df2fb9 100644
@@ -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;
 			}
@@ -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;
 			}
#1 lore raw
Quoted 3 lines · Roel Kluin

'ix' is unsigned but denormal_subf1() may return a negative int.

I'm at a loss as to why you couldn't be bothered CC'ing the appropriate list or anyone else on this, when you seem to have worked it out for other patches.

Anyways, applied.