]> granicus.if.org Git - clang/commitdiff
[analyzer] ccc-analyzer: Fix -isystem value passing.
authorDevin Coughlin <dcoughlin@apple.com>
Mon, 26 Oct 2015 17:19:51 +0000 (17:19 +0000)
committerDevin Coughlin <dcoughlin@apple.com>
Mon, 26 Oct 2015 17:19:51 +0000 (17:19 +0000)
The regex for -isystem matching is broken. -[D,I,Usystem] matches "-D", "-,",
"-I", "-U", "-s" "-y", etc. Besides that, "-isystem /foo" gets interpreted as
"-i" with a non-empty value "system" and thus the next "/foo" argument is not
read. This patch corrects the regex.

This fixes PR13237 <https://llvm.org/bugs/show_bug.cgi?id=13237>.

A patch by Peter Wu!

Differential Revision: http://reviews.llvm.org/D13800

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

tools/scan-build/ccc-analyzer

index 8bbb1037e6d17d177e7d61c00a128bf629f2f2e7..831dd42e9c9c0665ecbdb5449d04df9cb21fa567 100755 (executable)
@@ -586,7 +586,7 @@ foreach (my $i = 0; $i < scalar(@ARGV); ++$i) {
   }
 
   # Compile mode flags.
-  if ($Arg =~ /^-[D,I,U,isystem](.*)$/) {
+  if ($Arg =~ /^-(?:[DIU]|isystem)(.*)$/) {
     my $Tmp = $Arg;
     if ($1 eq '') {
       # FIXME: Check if we are going off the end.