1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 03:33:20 +01:00

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.

llvm-svn: 217397
This commit is contained in:
Hal Finkel 2014-09-08 19:31:25 +00:00
parent f4c0500cb9
commit 082ca75fd6

View File

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