//
//===----------------------------------------------------------------------===//
+#include "clang/AST/DeclCXX.h"
#include "clang/AST/ExprObjC.h"
#include "clang/Analysis/Analyses/LiveVariables.h"
#include "clang/Analysis/AnalysisContext.h"
case loc::MemRegionKind: {
const MemRegion* R = cast<loc::MemRegionVal>(loc).getRegion();
- if (!(isa<VarRegion>(R) || isa<ObjCIvarRegion>(R)))
+ if (!(isa<VarRegion>(R) || isa<ObjCIvarRegion>(R) ||
+ isa<CXXThisRegion>(R)))
return UnknownVal();
BindingsTy B = GetBindings(store);
R = ER->getSuperRegion();
}
- if (!(isa<VarRegion>(R) || isa<ObjCIvarRegion>(R)))
+ if (!(isa<VarRegion>(R) || isa<ObjCIvarRegion>(R) || isa<CXXThisRegion>(R)))
return store;
const TypedRegion *TyR = cast<TypedRegion>(R);
case loc::MemRegionKind: {
const MemRegion* R = cast<loc::MemRegionVal>(loc).getRegion();
- if (!(isa<VarRegion>(R) || isa<ObjCIvarRegion>(R)))
+ if (!(isa<VarRegion>(R) || isa<ObjCIvarRegion>(R) ||
+ isa<CXXThisRegion>(R)))
return store;
return VBFactory.Remove(GetBindings(store), R).getRoot();
continue;
}
else if (isa<ObjCIvarRegion>(I.getKey()) ||
- isa<NonStaticGlobalSpaceRegion>(I.getKey()))
+ isa<NonStaticGlobalSpaceRegion>(I.getKey()) ||
+ isa<CXXThisRegion>(I.getKey()))
RegionRoots.push_back(I.getKey());
else
continue;
break;
}
else if (isa<VarRegion>(MR) || isa<ObjCIvarRegion>(MR) ||
- isa<NonStaticGlobalSpaceRegion>(MR)) {
+ isa<NonStaticGlobalSpaceRegion>(MR) || isa<CXXThisRegion>(MR)) {
if (Marked.count(MR))
break;
// Process local scalar variables.
QualType T = VD->getType();
// BasicStore only supports scalars.
- if (T->isScalarType() && ValMgr.getSymbolManager().canSymbolicate(T)) {
+ if ((T->isScalarType() || T->isReferenceType()) &&
+ ValMgr.getSymbolManager().canSymbolicate(T)) {
SVal V = InitVal ? *InitVal : UndefinedVal();
store = Bind(store, loc::MemRegionVal(VR), V);
}