Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[analyzer] CStringChecker: Fix a crash on C++ overloads of standard f…
…unctions. It turns out that it's not all that uncommon to have a C++ override of, say, memcpy that receives a structure (or two) by reference (or by value, if it's being copied from) and copies memory from it (or into it, if it's passed by reference). In this case the argument will be of structure type (recall that expressions of reference type do not exist: instead, C++ classifies expressions into prvalues and lvalues and xvalues). In this scenario we crash because we are trying to assume that, say, a memory region is equal to an empty CompoundValue (the non-lazy one; this is what makeZeroVal() return for compound types and it represents prvalue of an object that is initialized with an empty initializer list). Add defensive checks. Differential Revision: https://reviews.llvm.org/D55873 rdar://problem/45366551 llvm-svn: 349682
- Loading branch information
Showing
1 changed file
with
56 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters