[Analyzer] Fix for SValBuilder expressions rearrangement
authorAdam Balogh <adam.balogh@ericsson.com>
Fri, 13 Apr 2018 20:23:02 +0000 (20:23 +0000)
committerAdam Balogh <adam.balogh@ericsson.com>
Fri, 13 Apr 2018 20:23:02 +0000 (20:23 +0000)
commit13e186c088e59797435edd25c139b36060be803d
treed36a80c0d291055881da2f904a1977773450ba8e
parentab40e44ba1b5ae97f53e5a885dbc93a4bed78302
[Analyzer] Fix for SValBuilder expressions rearrangement

Expression rearrangement in SValBuilder (see rL329780) crashes with an assert if the type of the integer is different from the type of the symbol. This fix adds a check that prevents rearrangement in such cases.

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

llvm-svn: 330064
clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp
clang/test/Analysis/svalbuilder-rearrange-comparisons.c