Commit c9349135 authored by Simon Pilgrim's avatar Simon Pilgrim
Browse files

[lldb] CxxModuleHandler - use cast<> instead of dyn_cast<> to avoid dereference of nullptr

The pointer is dereferenced immediately, so assert the cast is correct instead of returning nullptr
parent df0fd1c3
......@@ -138,7 +138,7 @@ getEqualLocalDeclContext(Sema &sema, DeclContext *foreign_ctxt) {
// We currently only support building namespaces.
if (foreign_ctxt->isNamespace()) {
NamedDecl *ns = llvm::dyn_cast<NamedDecl>(foreign_ctxt);
NamedDecl *ns = llvm::cast<NamedDecl>(foreign_ctxt);
llvm::StringRef ns_name = ns->getName();
auto lookup_result = emulateLookupInCtxt(sema, ns_name, *parent);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment