[llvm] Add the 'initializes' attribute langref and support (PR #84803)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Wed May 29 07:43:24 PDT 2024


================
@@ -2337,12 +2348,35 @@ Error BitcodeReader::parseAttributeGroupBlock() {
           if (!Attribute::isConstantRangeAttrKind(Kind))
             return error("Not a ConstantRange attribute");
 
-          Expected<ConstantRange> MaybeCR = readConstantRange(Record, i);
+          Expected<ConstantRange> MaybeCR =
+              readBitWidthAndConstantRange(Record, i);
           if (!MaybeCR)
             return MaybeCR.takeError();
           i--;
 
           B.addConstantRangeAttr(Kind, MaybeCR.get());
+        } else if (Record[i] == 8) {
+          Attribute::AttrKind Kind;
+          if (Error Err = parseAttrKind(Record[++i], &Kind))
+            return Err;
+          if (!Attribute::isConstantRangeListAttrKind(Kind))
+            return error("Not a constant range list attribute");
+
+          SmallVector<ConstantRange, 2> Val;
+          unsigned RangeSize = Record[++i];
+          unsigned BitWidth = Record[++i];
----------------
nikic wrote:

Missing bounds check before these accesses.

https://github.com/llvm/llvm-project/pull/84803


More information about the llvm-commits mailing list