[PATCH] D65239: [analyzer] RangeConstraintManager: Apply constraint ranges of bitwise operations

Csaba Dabis via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 24 12:37:32 PDT 2019


Charusso created this revision.
Charusso added a reviewer: NoQ.
Charusso added a project: clang.
Herald added subscribers: cfe-commits, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, szepet, baloghadamsoftware, xazax.hun.

We do not support evaluating bitwise operations, so that when we check for
their results being null previously we did a state-split because it is a
fresh new symbol and it could be null and non-null as well. The problem was
the left-hand side operand of the operation already has constraint range
informations which could contradicts with the current new assumption.
>From now we apply the constraint range informations of the left-hand side
operand in order to prevent false assumptions.


Repository:
  rC Clang

https://reviews.llvm.org/D65239

Files:
  clang/include/clang/AST/Expr.h
  clang/include/clang/StaticAnalyzer/Core/PathSensitive/RangedConstraintManager.h
  clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp
  clang/test/Analysis/bitwise-nullability.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D65239.211585.patch
Type: text/x-patch
Size: 6207 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190724/71542782/attachment.bin>


More information about the cfe-commits mailing list