From 79ba54f1b8fd30260aabef83313c6b25a88548da Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Wed, 23 Nov 2011 16:38:55 +0100 Subject: [PATCH] construct_invocation: add missing check for jobs size Signed-off-by: Sven Verdoolaege --- pet.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pet.cc b/pet.cc index ba4e001..8d316e8 100644 --- a/pet.cc +++ b/pet.cc @@ -530,6 +530,8 @@ static CompilerInvocation *construct_invocation(const char *filename, const llvm::OwningPtr compilation( driver->BuildCompilation(llvm::ArrayRef(Argv))); JobList &Jobs = compilation->getJobs(); + if (Jobs.size() < 1) + return NULL; Command *cmd = cast(*Jobs.begin()); if (strcmp(cmd->getCreator().getName(), "clang")) -- 2.11.4.GIT