Index: lib/CodeGen/GlobalMerge.cpp =================================================================== --- lib/CodeGen/GlobalMerge.cpp +++ lib/CodeGen/GlobalMerge.cpp @@ -511,6 +511,7 @@ if (!II) continue; const LandingPadInst *LPInst = II->getUnwindDest()->getLandingPadInst(); + if (!LPInst) continue; // Look for globals in the clauses of the landing pad instruction for (unsigned Idx = 0, NumClauses = LPInst->getNumClauses(); Idx != NumClauses; ++Idx)