[clang] [clang][Sema] Add bounds checking for libc poll (PR #177286)

Colin Kinloch via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 30 05:57:54 PST 2026


================
@@ -1140,6 +1143,152 @@ static bool ProcessFormatStringLiteral(const Expr *FormatExpr,
   return false;
 }
 
+static std::optional<int> getPathMaxValue(const ASTContext &Ctx) {
+  if (Ctx.getTargetInfo().getTriple().isOSGlibc())
+    return {4096};
----------------
ColinKinloch wrote:

Is there some trivial way to evaluate a macro I'm missing? Do you mean to traverse the AST context to get an expression to evaluate?
Or do you mean using the `evaluateSimpleMacroAtLocation` function?

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


More information about the cfe-commits mailing list