[clang] [clang][analyzer] Add allocation failure modeling to DynamicMemoryModeling (PR #205371)
DonĂ¡t Nagy via cfe-commits
cfe-commits at lists.llvm.org
Thu Jun 25 02:17:08 PDT 2026
================
@@ -512,7 +512,14 @@ def DynamicMemoryModeling: Checker<"DynamicMemoryModeling">,
"NoStoreFuncVisitor.",
"true",
Released,
- Hide>
+ Hide>,
+ CmdLineOption<Boolean,
+ "ModelAllocationFailure",
+ "At allocation functions, add extra execution branches for "
+ "failed memory allocation (function returns null value when "
+ "size is non-null) if applicable.",
+ "false",
+ Released>
----------------
NagyDonat wrote:
That is one possible approach, but I don't think that documenting _all_ the modeling checkers is necessary here. Only a few of the modeling checkers have user-visible config options, while the rest are purely internal implementation details.
Also, I think in the future we should move towards completely hiding the modeling checkers and disconnecting the user-facing config options from them. If you document them, please include a warning message that "These modeling checkers are implementation details, they may be renamed or hidden in the future."
https://github.com/llvm/llvm-project/pull/205371
More information about the cfe-commits
mailing list