teemperor created this revision.
teemperor added a reviewer: shafik.
Herald added subscribers: lldb-commits, abidh.
Herald added a project: LLDB.

If we call this function with a non-namespace as a second argument (and a 
nullptr name), we currently
only get a nullptr as a return when we hit the "Bad!!!" code path. This patch 
just adds an assert as this
seems to be a programming error in the calling code.


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D57880

Files:
  source/Symbol/ClangASTContext.cpp


Index: source/Symbol/ClangASTContext.cpp
===================================================================
--- source/Symbol/ClangASTContext.cpp
+++ source/Symbol/ClangASTContext.cpp
@@ -1941,7 +1941,8 @@
         assert(namespace_decl ==
                parent_namespace_decl->getAnonymousNamespace());
       } else {
-        // BAD!!!
+        assert(false && "GetUniqueNamespaceDeclaration called with no name and 
"
+                        "no namespace as decl_ctx");
       }
     }
   }


Index: source/Symbol/ClangASTContext.cpp
===================================================================
--- source/Symbol/ClangASTContext.cpp
+++ source/Symbol/ClangASTContext.cpp
@@ -1941,7 +1941,8 @@
         assert(namespace_decl ==
                parent_namespace_decl->getAnonymousNamespace());
       } else {
-        // BAD!!!
+        assert(false && "GetUniqueNamespaceDeclaration called with no name and "
+                        "no namespace as decl_ctx");
       }
     }
   }
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
  • [Lldb-commits] [PATCH] D5... Raphael Isemann via Phabricator via lldb-commits

Reply via email to