diff --git a/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp b/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp --- a/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp @@ -98,7 +98,8 @@ DenseMap> CatchObjects; EHPersonality Personality = classifyEHPersonality( Fn->hasPersonalityFn() ? Fn->getPersonalityFn() : nullptr); - if (isFuncletEHPersonality(Personality)) { + bool IsFuncletEHPersonality = isFuncletEHPersonality(Personality); + if (IsFuncletEHPersonality) { // Calculate state numbers if we haven't already. WinEHFuncInfo &EHInfo = *MF->getWinEHFuncInfo(); if (Personality == EHPersonality::MSVC_CXX) @@ -169,6 +170,8 @@ // a single dynamic allocation instead of using a separate // stack allocation for each one. // Inform the Frame Information that we have variable-sized objects. + assert(!IsFuncletEHPersonality && + "CatchObjects must be fixed objects"); MF->getFrameInfo().CreateVariableSizedObject( Alignment <= StackAlign ? Align(1) : Alignment, AI); }