From 60166adec55dc15fed77ccfcd5dad5fda22df6af Mon Sep 17 00:00:00 2001 From: Jacob Lifshay Date: Mon, 25 Apr 2022 23:16:55 -0700 Subject: [PATCH] fix UB caused by lkcl in 1afca349cc91beebe7fd04260e0f9e9dbf85eb06 --- openpower/sv/biginteger/divmnu64.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openpower/sv/biginteger/divmnu64.c b/openpower/sv/biginteger/divmnu64.c index 8783f8d1a..0d3f3973a 100644 --- a/openpower/sv/biginteger/divmnu64.c +++ b/openpower/sv/biginteger/divmnu64.c @@ -98,7 +98,7 @@ int divmnu(unsigned q[], unsigned r[], const unsigned u[], const unsigned v[], k = 0; // the case of a for (j = m - 1; j >= 0; j--) { // single-digit - uint64_t dig2 = (k << 32) | u[j]; + uint64_t dig2 = ((uint64_t)k << 32) | u[j]; q[j] = dig2 / v[0]; // divisor here. k = dig2 % v[0]; // modulo back into next loop } -- 2.30.2