NagyDonat wrote:

Personally I feel that option 2 ("add more error handling to avoid crashes in 
`checkGetdelim`") would be more "natural" for the static analyzer, because 
checking the exact types of the parameters is rare in the analyzer (I don't 
know any significant example apart from `StdLibraryFunctionsChecker`). Not 
checking the exact types is also useful because this makes the analyzer more 
robust against slight differences between different standard library 
implementations (e.g. MSVC headers are notorious for minor awkward differences).

Your concern that "However, we will still try to model "incorrect" `getline` 
methods, wasting cpu." is _very_ premature optimization, the runtime change 
would be totally negligible -- and probably less than the (also negligible) 
cost of detailed type checking. The majority of the analyzer runtime is focused 
in a few hot spots, while the majority of the logic is mostly irrelevant from a 
performance POV.


https://github.com/llvm/llvm-project/pull/145229
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to