From beeca5486480c946874bd98276a7f32188588fce Mon Sep 17 00:00:00 2001 From: Hal Finkel Date: Mon, 8 Sep 2014 19:31:25 +0000 Subject: [PATCH] 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 --- include/llvm/Analysis/AssumptionTracker.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/llvm/Analysis/AssumptionTracker.h b/include/llvm/Analysis/AssumptionTracker.h index 5e09b0ac654..80ae513f4f9 100644 --- a/include/llvm/Analysis/AssumptionTracker.h +++ b/include/llvm/Analysis/AssumptionTracker.h @@ -66,7 +66,7 @@ class AssumptionTracker : public ImmutablePass { operator CallInst*() const { Value *V = getValPtr(); if (V == DMI::getEmptyKey() || V == DMI::getTombstoneKey()) - return static_cast(V); + return reinterpret_cast(V); return cast(V); }