HomePhabricator

[analyzer] Be more forgiving about calling methods on struct rvalues.

Authored by jordan_rose on Sep 5 2012, 10:11 AM.

Description

[analyzer] Be more forgiving about calling methods on struct rvalues.

The problem is that the value of 'this' in a C++ member function call
should always be a region (or NULL). However, if the object is an rvalue,
it has no associated region (only a conjured symbol or LazyCompoundVal).
For now, we handle this in two ways:

  1. Actually respect MaterializeTemporaryExpr. Before, it was relying on CXXConstructExpr to create temporary regions for all struct values. Now it just does the right thing: if the value is not in a temporary region, create one.
  1. Have CallEvent recognize the case where its 'this' pointer is a non-region, and just return UnknownVal to keep from confusing clients.

The long-term problem is being tracked internally in rdar://problem/12137950,
but this makes many test cases pass.

llvm-svn: 163220

Details

Committed
jordan_roseSep 5 2012, 10:11 AM
Parents
rGd1a08b6e4376: [analyzer] Clean up a couple uses of getPointeeType().
Branches
Unknown
Tags
Unknown