diff options
author | Manna, Soumi <soumi.manna@intel.com> | 2023-06-28 19:25:46 -0700 |
---|---|---|
committer | Manna, Soumi <soumi.manna@intel.com> | 2023-06-28 19:25:53 -0700 |
commit | 7372c0d46d2185017c509eb30910b102b4f9cdaa (patch) | |
tree | 2d7e825e1a15d0132e7ed1e6719a47c5713f3af7 /llvm/lib/CodeGen/MachineFunction.cpp | |
parent | 04dabc252704a2b211bcfec791bf10d30d1400e8 (diff) | |
download | llvm-7372c0d46d2185017c509eb30910b102b4f9cdaa.zip llvm-7372c0d46d2185017c509eb30910b102b4f9cdaa.tar.gz llvm-7372c0d46d2185017c509eb30910b102b4f9cdaa.tar.bz2 |
[CLANG] Fix potential integer overflow value in getRVVTypeSize()
In getRVVTypeSize(clang::ASTContext &, clang::BuiltinType const *) potential integer overflow occurs on expression VScale->first * MinElts with type unsigned int (32 bits, unsigned) is evaluated using 32-bit arithmetic, and then used in a context that expects an expression of type uint64_t (64 bits, unsigned).
To avoid integer overflow, this patch changes the types of variables MinElts and EltSize to uint64_t from unsigned instead of the cast.
Reviewed By: erichkeane
Differential Revision: https://reviews.llvm.org/D153146
Diffstat (limited to 'llvm/lib/CodeGen/MachineFunction.cpp')
0 files changed, 0 insertions, 0 deletions