================
@@ -1601,6 +1601,23 @@ void 
Sema::checkFortifiedBuiltinMemoryFunction(FunctionDecl *FD,
     BufferSize = Checker.ComputeSizeArgument(0);
     break;
   }
+  case Builtin::BIrealpath: {
+    BufferSize = Checker.ComputeSizeArgument(1);
+    if (!BufferSize)
+      return;
+    const llvm::Triple &T = Context.getTargetInfo().getTriple();
+    uint64_t PathMax = 0;
+    if (T.isOSLinux() || T.isOSFuchsia() || T.isOSAIX() || T.isOSHaiku())
+      PathMax = 4096;
+    else if (T.isOSDarwin() || T.isOSFreeBSD() || T.isOSNetBSD() ||
+             T.isOSOpenBSD() || T.isOSSolaris())
+      PathMax = 1024;
+    else
----------------
ojhunt wrote:

This smells of copy pasta -- assuming this logic exists elsewhere it should be 
placed in a helper function

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

Reply via email to