[all-commits] [llvm/llvm-project] d49aa4: [analyzer] `SValBuilder::evalBinOpLN`: try simplif...

guillem-bartrina-sonarsource via All-commits all-commits at lists.llvm.org
Tue Oct 14 01:26:09 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d49aa40fc703d061f48e520b9c1b63e6646c6907
      https://github.com/llvm/llvm-project/commit/d49aa40fc703d061f48e520b9c1b63e6646c6907
  Author: guillem-bartrina-sonarsource <guillem.bartrina at sonarsource.com>
  Date:   2025-10-14 (Tue, 14 Oct 2025)

  Changed paths:
    M clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp
    A clang/test/Analysis/loc-folding.cpp

  Log Message:
  -----------
  [analyzer] `SValBuilder::evalBinOpLN`: try simplifying the RHS first (#161537)

The first thing `SValBuilder::evalBinOpNN` does is simplify both
operators
([here](https://github.com/llvm/llvm-project/blob/main/clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp#L430-L437)),
why wouldn't we simplify the RHS in `SValBuilder::evalBinOpLN`?

When the LHS is an `Element`, the right side is simplified incidentally
when calling `evalBinOpNN`
([here](https://github.com/llvm/llvm-project/blob/main/clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp#L1169-L1170)).

Without this patch, the “base_complex” test case is **UNKNOWN** instead of **TRUE**.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list