diff options
author | Kadir Cetinkaya <kadircet@google.com> | 2021-09-16 17:43:15 +0200 |
---|---|---|
committer | Kadir Cetinkaya <kadircet@google.com> | 2021-09-20 16:51:56 +0200 |
commit | 444a5f304f6c2c332f18392d2458d74664e98498 (patch) | |
tree | dc4dd773dc354297ab859f6bdba8113549e0c01f /clang/lib/Frontend/CreateInvocationFromCommandLine.cpp | |
parent | 6db928b8f31b17caf205eee9c95bb817e51a3f2c (diff) | |
download | llvm-444a5f304f6c2c332f18392d2458d74664e98498.zip llvm-444a5f304f6c2c332f18392d2458d74664e98498.tar.gz llvm-444a5f304f6c2c332f18392d2458d74664e98498.tar.bz2 |
[clangd] Bail-out when an empty compile flag is encountered
Fixes https://github.com/clangd/clangd/issues/865
Differential Revision: https://reviews.llvm.org/D109894
Diffstat (limited to 'clang/lib/Frontend/CreateInvocationFromCommandLine.cpp')
-rw-r--r-- | clang/lib/Frontend/CreateInvocationFromCommandLine.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/clang/lib/Frontend/CreateInvocationFromCommandLine.cpp b/clang/lib/Frontend/CreateInvocationFromCommandLine.cpp index 2a14b7a..c5627d1 100644 --- a/clang/lib/Frontend/CreateInvocationFromCommandLine.cpp +++ b/clang/lib/Frontend/CreateInvocationFromCommandLine.cpp @@ -30,6 +30,7 @@ std::unique_ptr<CompilerInvocation> clang::createInvocationFromCommandLine( ArrayRef<const char *> ArgList, IntrusiveRefCntPtr<DiagnosticsEngine> Diags, IntrusiveRefCntPtr<llvm::vfs::FileSystem> VFS, bool ShouldRecoverOnErorrs, std::vector<std::string> *CC1Args) { + assert(!ArgList.empty()); if (!Diags.get()) { // No diagnostics engine was provided, so create our own diagnostics object // with the default options. |