Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9731e287 authored by Roel Kluin's avatar Roel Kluin Committed by Paul Mundt
Browse files

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



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

Signed-off-by: default avatarRoel Kluin <12o3l@tiscali.nl>
Signed-off-by: default avatarPaul Mundt <lethal@linux-sh.org>
parent cdf7da89
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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;
			}