[PATCH] D153146: [CLANG] Fix potential integer overflow value in getRVVTypeSize()

Soumi Manna via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 28 19:30:13 PDT 2023


This revision was automatically updated to reflect the committed changes.
Closed by commit rG7372c0d46d21: [CLANG] Fix potential integer overflow value in getRVVTypeSize() (authored by Manna).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D153146/new/

https://reviews.llvm.org/D153146

Files:
  clang/lib/AST/ASTContext.cpp


Index: clang/lib/AST/ASTContext.cpp
===================================================================
--- clang/lib/AST/ASTContext.cpp
+++ clang/lib/AST/ASTContext.cpp
@@ -9564,8 +9564,8 @@
 
   ASTContext::BuiltinVectorTypeInfo Info = Context.getBuiltinVectorTypeInfo(Ty);
 
-  unsigned EltSize = Context.getTypeSize(Info.ElementType);
-  unsigned MinElts = Info.EC.getKnownMinValue();
+  uint64_t EltSize = Context.getTypeSize(Info.ElementType);
+  uint64_t MinElts = Info.EC.getKnownMinValue();
   return VScale->first * MinElts * EltSize;
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D153146.535607.patch
Type: text/x-patch
Size: 550 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230629/f29b9fe9/attachment.bin>


More information about the cfe-commits mailing list