Skip to content
Commit 7372c0d4 authored by Manna, Soumi's avatar Manna, Soumi
Browse files

[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
parent 04dabc25
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment