================
@@ -2048,6 +2091,27 @@ ProgramStateRef 
MallocChecker::MallocMemAux(CheckerContext &C,
   return MallocUpdateRefState(C, CE, State, Family);
 }
 
+ProgramStateRef
+MallocChecker::FailedAlloc(CheckerContext &C, const CallEvent &Call,
+                           ProgramStateRef State,
+                           llvm::ArrayRef<unsigned> SizeArgIndexes) const {
+  if (!State || !ModelAllocationFailure)
+    return nullptr;
+
+  for (unsigned SizeArgI : SizeArgIndexes) {
+    auto DefArgVal = Call.getArgSVal(SizeArgI).getAs<DefinedOrUnknownSVal>();
----------------
steakhal wrote:

I think part of this translation, we lost the safety check for out of bounds 
indexes. I think we should at least have an assert guarding this accessor.

https://github.com/llvm/llvm-project/pull/205371
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to