diff --git a/llvm/lib/Transforms/Coroutines/CoroFrame.cpp b/llvm/lib/Transforms/Coroutines/CoroFrame.cpp --- a/llvm/lib/Transforms/Coroutines/CoroFrame.cpp +++ b/llvm/lib/Transforms/Coroutines/CoroFrame.cpp @@ -1863,6 +1863,8 @@ if (LdInst->getPointerOperandType() != LdInst->getType()) break; CurDef = LdInst->getPointerOperand(); + if (!(isa(CurDef) || isa(CurDef))) + break; DIs = FindDbgDeclareUses(CurDef); } }