================
@@ -577,6 +577,21 @@ bool llvm::inferNonMandatoryLibFuncAttrs(Function &F,
     Changed |= setDoesNotCapture(F, 0);
     Changed |= setArgNoUndef(F, 1);
     break;
+  case LibFunc_reallocarray:
+    Changed |= setAllocFamily(F, "malloc");
+    Changed |= setAllocKind(F, AllocFnKind::Realloc);
+    Changed |= setAllocatedPointerParam(F, 0);
+    Changed |= setAllocSize(F, 1, std::nullopt);
+    Changed |= setAllocSize(F, 2, std::nullopt);
----------------
nikic wrote:

That's not how it works, this needs to be:
```suggestion
    Changed |= setAllocSize(F, 1, 2);
```

https://github.com/llvm/llvm-project/pull/114818
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to