================
@@ -2950,16 +2951,32 @@ void StdLibraryFunctionsChecker::initFunctionSummaries(
     // void *mmap(void *addr, size_t length, int prot, int flags, int fd,
     // off_t offset);
     // FIXME: Improve for errno modeling.
-    addToFunctionSummaryMap(
-        "mmap",
-        Signature(
-            ArgTypes{VoidPtrTy, SizeTyCanonTy, IntTy, IntTy, IntTy, Off_tTy},
-            RetType{VoidPtrTy}),
-        Summary(NoEvalCall)
-            .ArgConstraint(ArgumentCondition(1, WithinRange, Range(1, 
SizeMax)))
-            .ArgConstraint(
-                ArgumentCondition(4, WithinRange, Range(-1, IntMax))));
-
+    if (ACtx.getTargetInfo().getTriple().isOSDarwin()) {
+        // On Darwin, MAP_ANON + VM_MAKE_TAG(tag) uses argument 4 (len) for
+        // the tag, which looks like a large negative signed integer. The
+        // valid range for fd is not expressible as a simple union of ranges
+        // so omit the constraint.
----------------
steakhal wrote:

Could you reflow the comment to start the new sentence in a new line? This 
would impact the flow a bit and wrap the next line a bit sooner, but it would 
still take up 3 lines and would read a bit more naturally - at least for me.
I hate when a line ends with `. The` just to tease you to find the beginning of 
the next line.

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

Reply via email to