Don't static_cast invalid pointers

UBSan complained about using static_cast on the invalid (tombstone, etc.)
pointers used by DenseMap. Use a reinterpret_cast instead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217397 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Hal Finkel 2014-09-08 19:31:25 +00:00
parent e769dc39fd
commit beeca54864

View File

@ -66,7 +66,7 @@ class AssumptionTracker : public ImmutablePass {
operator CallInst*() const {
Value *V = getValPtr();
if (V == DMI::getEmptyKey() || V == DMI::getTombstoneKey())
return static_cast<CallInst*>(V);
return reinterpret_cast<CallInst*>(V);
return cast<CallInst>(V);
}