[PATCH] D35109: [Analyzer] SValBuilder Comparison Rearrangement

Devin Coughlin via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 26 00:06:23 PDT 2017


dcoughlin added a comment.

I have some concerns about soundness when the rearrangement may overflow.

Here is an example:

  void clang_analyzer_eval(int);
  
  void foo(signed char A, signed char B) {
    if (A + 0 >= B + 0) {
      clang_analyzer_eval(A - 126 == B + 3); // This yields FALSE with this patch
    }
  }

But for A = 126 and B = -3 the `clang_analyzer_eval` is reachable and should evaluate to true.


https://reviews.llvm.org/D35109





More information about the cfe-commits mailing list