[all-commits] [llvm/llvm-project] 5f8dca: [Analyzer] Extend ConstraintAssignor to handle rem...

Gabor Marton via All-commits all-commits at lists.llvm.org
Fri Oct 22 01:54:04 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5f8dca023504ed21490a40ddc3a0241029782910
      https://github.com/llvm/llvm-project/commit/5f8dca023504ed21490a40ddc3a0241029782910
  Author: Gabor Marton <gabor.marton at ericsson.com>
  Date:   2021-10-22 (Fri, 22 Oct 2021)

  Changed paths:
    M clang/include/clang/StaticAnalyzer/Core/PathSensitive/RangedConstraintManager.h
    M clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp
    A clang/test/Analysis/constraint-assignor.c

  Log Message:
  -----------
  [Analyzer] Extend ConstraintAssignor to handle remainder op

Summary:
`a % b != 0` implies that `a != 0` for any `a` and `b`. This patch
extends the ConstraintAssignor to do just that. In fact, we could do
something similar with division and in case of multiplications we could
have some other inferences, but I'd like to keep these for future
patches.

Fixes https://bugs.llvm.org/show_bug.cgi?id=51940

Reviewers: noq, vsavchenko, steakhal, szelethus, asdenyspetrov

Subscribers:

Differential Revision: https://reviews.llvm.org/D110357




More information about the All-commits mailing list