summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/test/clang-tidy/cppcoreguidelines-owning-memory.cpp
diff options
context:
space:
mode:
authorArtem Dergachev <artem.dergachev@gmail.com>2017-10-04 15:59:40 +0000
committerArtem Dergachev <artem.dergachev@gmail.com>2017-10-04 15:59:40 +0000
commit9445b89c498d8cc4de3f77ae461e594548a95402 (patch)
treebe34571ba5da6015cd5514d96401db94cb0b1a37 /clang-tools-extra/test/clang-tidy/cppcoreguidelines-owning-memory.cpp
parent6c381b7a2ed9df81d2cbc0e69a30ff6482965fd5 (diff)
downloadbcm5719-llvm-9445b89c498d8cc4de3f77ae461e594548a95402.tar.gz
bcm5719-llvm-9445b89c498d8cc4de3f77ae461e594548a95402.zip
[analyzer] Fix autodetection of binding types.
In ProgramState::getSVal(Location, Type) API which dereferences a pointer value, when the optional Type parameter is not supplied and the Location is not typed, type should have been guessed on a best-effort basis by inspecting the Location more deeply. However, this never worked; the auto-detected type was instead a pointer type to the correct type. Fixed the issue and added various test cases to demonstrate which parts of the analyzer were affected (uninitialized pointer argument checker, C++ trivial copy modeling, Google test API modeling checker). Additionally, autodetected void types are automatically replaced with char, in order to simplify checker APIs. Which means that if the location is a void pointer, getSVal() would read the first byte through this pointer and return its symbolic value. Fixes pr34305. Differential Revision: https://reviews.llvm.org/D38358 llvm-svn: 314910
Diffstat (limited to 'clang-tools-extra/test/clang-tidy/cppcoreguidelines-owning-memory.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud