[PATCH] D150140: [NFC][CLANG] Fix Static Code Analysis Concerns

Soumi Manna via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 9 07:04:47 PDT 2023


Manna updated this revision to Diff 520681.
Manna edited the summary of this revision.
Manna added a comment.

Thank you for reviews and comments @erichkeane and @sdesmalen!  I have updated patch.


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

https://reviews.llvm.org/D150140

Files:
  clang/utils/TableGen/SveEmitter.cpp


Index: clang/utils/TableGen/SveEmitter.cpp
===================================================================
--- clang/utils/TableGen/SveEmitter.cpp
+++ clang/utils/TableGen/SveEmitter.cpp
@@ -299,6 +299,7 @@
     if (It != FlagTypes.end()) {
       uint64_t Mask = It->getValue();
       unsigned Shift = llvm::countr_zero(Mask);
+      assert(Mask != 0 && "Mask is out of encodable range");
       return (V << Shift) & Mask;
     }
     llvm_unreachable("Unsupported flag");


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D150140.520681.patch
Type: text/x-patch
Size: 480 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230509/1eb6e690/attachment.bin>


More information about the cfe-commits mailing list