r251312 - [analyzer] ccc-analyzer: Fix -isystem value passing.

Devin Coughlin via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 26 10:19:51 PDT 2015


Author: dcoughlin
Date: Mon Oct 26 12:19:51 2015
New Revision: 251312

URL: http://llvm.org/viewvc/llvm-project?rev=251312&view=rev
Log:
[analyzer] ccc-analyzer: Fix -isystem value passing.

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

Modified:
    cfe/trunk/tools/scan-build/ccc-analyzer

Modified: cfe/trunk/tools/scan-build/ccc-analyzer
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/scan-build/ccc-analyzer?rev=251312&r1=251311&r2=251312&view=diff
==============================================================================
--- cfe/trunk/tools/scan-build/ccc-analyzer (original)
+++ cfe/trunk/tools/scan-build/ccc-analyzer Mon Oct 26 12:19:51 2015
@@ -586,7 +586,7 @@ foreach (my $i = 0; $i < scalar(@ARGV);
   }
 
   # 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.




More information about the cfe-commits mailing list