diff options
Diffstat (limited to 'lib/Analysis/GRExprEngine.cpp')
-rw-r--r-- | lib/Analysis/GRExprEngine.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/Analysis/GRExprEngine.cpp b/lib/Analysis/GRExprEngine.cpp index 4a960c6937..daa249f901 100644 --- a/lib/Analysis/GRExprEngine.cpp +++ b/lib/Analysis/GRExprEngine.cpp @@ -1483,10 +1483,13 @@ static bool EvalOSAtomicCompareAndSwap(ExplodedNodeSet& Dst, ExplodedNodeSet Tmp; SVal location = state->getSVal(theValueExpr); // Here we should use the value type of the region as the load type. - const MemRegion *R = location.getAsRegion(); + const MemRegion *R = location.getAsRegion()->StripCasts(); QualType LoadTy; - if (R) + if (R) { LoadTy = cast<TypedRegion>(R)->getValueType(C); + // Use the region as the real load location. + location = loc::MemRegionVal(R); + } Engine.EvalLoad(Tmp, theValueExpr, Pred, state, location, OSAtomicLoadTag, LoadTy); |