aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp')
-rw-r--r--llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
index 737a997..c298172 100644
--- a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
+++ b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
@@ -2144,8 +2144,9 @@ bool TargetLoweringObjectFileXCOFF::ShouldEmitEHBlock(
if (!F.hasPersonalityFn() || !F.needsUnwindTableEntry())
return false;
- const Function *Per =
- dyn_cast<Function>(F.getPersonalityFn()->stripPointerCasts());
+ const GlobalValue *Per =
+ dyn_cast<GlobalValue>(F.getPersonalityFn()->stripPointerCasts());
+ assert(Per && "Personality routine is not a GlobalValue type.");
if (isNoOpWithoutInvoke(classifyEHPersonality(Per)))
return false;