manas marked 3 inline comments as done. manas added a comment. Thanks Valeriy.
================ Comment at: clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp:1490 + // the resulting range should be [Min, Max]. + if (ResultType.isUnsigned()) { + return {RangeFactory, ValueFactory.getValue(Min), ---------------- vsavchenko wrote: > Maybe you can include this as yet another condition in the next `if` > statement? Their bodies are identical. True. I wanted to optimize the following `if` condition as it looks quite ugly right now! Although, I will concatenate these conditions for now and work on the optimization later. ================ Comment at: clang/test/Analysis/constant-folding.c:399 + // (a - b) = [0, 5] U [UINT_MAX - 9, UINT_MAX] + clang_analyzer_eval((a - b) != 6); // expected-warning{{TRUE}} + clang_analyzer_eval((a - b) != UINT_MAX - 10); // expected-warning{{TRUE}} ---------------- vsavchenko wrote: > Maybe you can check `(a - b) > 5 && (a - b) < UINT_MAX - 9` to cover the > whole range? That's true! I never thought of putting them together. Makes more sense. ================ Comment at: clang/test/Analysis/constant-folding.c:405 + + if (c >= INT_MAX - 5 && d >= INT_MAX - 5) { + // (c - d) = [-5, 5] ---------------- vsavchenko wrote: > This is also Min and Max overflowing on the positive side. I missed it! I will add another case for only Max overflowing on positive side and will keep this test as well. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D105273/new/ https://reviews.llvm.org/D105273 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits