forked from OSchip/llvm-project
parent
200c99dd1e
commit
803ade2532
|
@ -66,6 +66,9 @@ SValuator::CastResult SValuator::EvalCast(SVal val, const GRState *state,
|
|||
if (C.hasSameUnqualifiedType(castTy, originalTy))
|
||||
return CastResult(state, val);
|
||||
|
||||
if (castTy->isIntegerType() && originalTy->isIntegerType())
|
||||
return CastResult(state, EvalCastNL(cast<NonLoc>(val), castTy));
|
||||
|
||||
// Check for casts from pointers to integers.
|
||||
if (castTy->isIntegerType() && Loc::IsLocType(originalTy))
|
||||
return CastResult(state, EvalCastL(cast<Loc>(val), castTy));
|
||||
|
|
|
@ -57,3 +57,14 @@ void doit(char *data, int len) {
|
|||
memcpy(buf, data, len);
|
||||
}
|
||||
}
|
||||
|
||||
struct pcm_feeder {
|
||||
void *data;
|
||||
};
|
||||
// Test cast a pointer to long and then to int does not crash SValuator.
|
||||
void feed_swaplr (struct pcm_feeder *f)
|
||||
{
|
||||
int bps;
|
||||
bps = (long) f->data;
|
||||
(void) bps;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue