projects
/
libreriscv.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
59f157d
)
fix UB caused by lkcl in 1afca349cc91beebe7fd04260e0f9e9dbf85eb06
author
Jacob Lifshay
<programmerjake@gmail.com>
Tue, 26 Apr 2022 06:16:55 +0000
(23:16 -0700)
committer
Jacob Lifshay
<programmerjake@gmail.com>
Tue, 26 Apr 2022 06:16:55 +0000
(23:16 -0700)
openpower/sv/biginteger/divmnu64.c
patch
|
blob
|
history
diff --git
a/openpower/sv/biginteger/divmnu64.c
b/openpower/sv/biginteger/divmnu64.c
index 8783f8d1a65c59f0fbd4e0546e9940474721e06a..0d3f3973ac19708e4d274dcba8e473fd30df8d79 100644
(file)
--- 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
}