[Lldb-commits] [PATCH] D51387: Allow Template argument accessors to automatically unwrap parameter packs

Jim Ingham via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Sep 13 17:54:59 PDT 2018


jingham requested changes to this revision.
jingham added a comment.
This revision now requires changes to proceed.

I'm a little worried that we have asserts with no backstops here.  We ship in general with asserts off, so if some type is not copasetic we will probably crash shortly afterwards (in one case we assert num_args but then do an array access of num_args - 1)...

Seems like in the places where you've added asserts, we could return 0 (no template arguments) and though we wouldn't print the type correctly lldb wouldn't crash.  We should always assume that debug info might a little crappy and not crash.  Maybe these Decl's have been vetted earlier?  If that's the case I withdraw the objection.



================
Comment at: source/Symbol/ClangASTContext.cpp:7568-7570
+          assert(
+              num_args &&
+              "We shouldn't have a template specialization without any args");
----------------
IIUC, we would get into this state because debug information is messed up.  lldb should never crash because of mal-formed debug information.  It's fine to assert here so that if this happens say in a new compiler we can catch it in the test suite.  But you should also return 0, since that's a straightforward workaround for bad debug information.


https://reviews.llvm.org/D51387





More information about the lldb-commits mailing list