When conjuring symbols for compound assignments, use the promoted type to determine if the symbolic value as a "loc::" or "nonloc::" value.

llvm-svn: 57917
This commit is contained in:
Ted Kremenek 2008-10-21 19:49:01 +00:00
parent 4ddf7a4c22
commit 677fba12a5
1 changed files with 4 additions and 4 deletions

View File

@ -2208,13 +2208,13 @@ void GRExprEngine::VisitBinaryOperator(BinaryOperator* B,
// EXPERIMENTAL: "Conjured" symbols.
// FIXME: Handle structs.
QualType T = RHS->getType();
if (Result.isUnknown() && (T->isIntegerType() || Loc::IsLocType(T))) {
if (Result.isUnknown() &&
(CTy->isIntegerType() || Loc::IsLocType(CTy))) {
unsigned Count = Builder->getCurrentBlockCount();
SymbolID Sym = SymMgr.getConjuredSymbol(B->getRHS(), Count);
Result = Loc::IsLocType(B->getRHS()->getType())
Result = Loc::IsLocType(CTy)
? cast<SVal>(loc::SymbolVal(Sym))
: cast<SVal>(nonloc::SymbolVal(Sym));
}