Skip to content

Commit 53689f2

Browse files
fix: prevent bad argument pop back when querying toolchain (#342)
1 parent f30f68f commit 53689f2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Compiler/Command.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -730,7 +730,11 @@ CompilationContext CompilationDatabase::lookup(llvm::StringRef file,
730730
}
731731
}
732732

733-
arguments.pop_back();
733+
if(arguments.empty()) {
734+
LOG_WARN("failed to query toolchain: {}", file);
735+
} else {
736+
arguments.pop_back();
737+
}
734738
}
735739

736740
arguments.emplace_back(file.data());

0 commit comments

Comments
 (0)