From: Hal Finkel Date: Mon, 8 Sep 2014 19:31:25 +0000 (+0000) Subject: Don't static_cast invalid pointers X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=beeca5486480c946874bd98276a7f32188588fce;p=oota-llvm.git 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 --- 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); }