[PATCH] D146623: [compiler-rt] Fix signed integer overflow in int_mulo_impl.inc
Karl-Johan Karlsson via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 24 03:11:29 PDT 2023
This revision was automatically updated to reflect the committed changes.
Closed by commit rGff426a6250e9: [compiler-rt] Fix signed integer overflow in int_mulo_impl.inc (authored by Ka-Ka).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D146623/new/
https://reviews.llvm.org/D146623
Files:
compiler-rt/lib/builtins/int_mulo_impl.inc
Index: compiler-rt/lib/builtins/int_mulo_impl.inc
===================================================================
--- compiler-rt/lib/builtins/int_mulo_impl.inc
+++ compiler-rt/lib/builtins/int_mulo_impl.inc
@@ -21,7 +21,7 @@
const fixint_t MIN = (fixint_t)((fixuint_t)1 << (N - 1));
const fixint_t MAX = ~MIN;
*overflow = 0;
- fixint_t result = a * b;
+ fixint_t result = (fixuint_t)a * b;
if (a == MIN) {
if (b != 0 && b != 1)
*overflow = 1;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D146623.508016.patch
Type: text/x-patch
Size: 474 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230324/3dda15ef/attachment.bin>
More information about the llvm-commits
mailing list