]> granicus.if.org Git - clang/commitdiff
[scan-build] Be friendly to "" in the argument list.
authorAnna Zaks <ganna@apple.com>
Sat, 28 Mar 2015 02:17:21 +0000 (02:17 +0000)
committerAnna Zaks <ganna@apple.com>
Sat, 28 Mar 2015 02:17:21 +0000 (02:17 +0000)
Do not fail when "" is one of the compilation arguments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@233465 91177308-0d34-0410-b5e6-96231b3b80d8

tools/scan-build/ccc-analyzer

index aa02653a49e3d79c0d299e6a4786df1322ea7ffd..4549b29a806e8e0be844723c5f4e9c0020bf71c9 100755 (executable)
@@ -492,6 +492,11 @@ foreach (my $i = 0; $i < scalar(@ARGV); ++$i) {
   my $Arg = $ARGV[$i];
   my ($ArgKey) = split /=/,$Arg,2;
 
+  # Be friendly to "" in the argument list.
+  if (!defined($ArgKey)) {
+    next;
+  }
+
   # Modes ccc-analyzer supports
   if ($Arg =~ /^-(E|MM?)$/) { $Action = 'preprocess'; }
   elsif ($Arg eq '-c') { $Action = 'compile'; }