From 082ca75fd626c252d1bf8f4955307bb8045daada 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. llvm-svn: 217397 --- 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); }