[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
Loading
Please sign in to comment