Lekensteyn created this revision.
Lekensteyn added a reviewer: krememek.
Lekensteyn added a subscriber: cfe-commits.

The previous and current regex are 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.

Fixes https://llvm.org/bugs/show_bug.cgi?id=13237

http://reviews.llvm.org/D13800

Files:
  tools/scan-build/ccc-analyzer

Index: tools/scan-build/ccc-analyzer
===================================================================
--- tools/scan-build/ccc-analyzer
+++ tools/scan-build/ccc-analyzer
@@ -586,7 +586,7 @@
   }
 
   # 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.


Index: tools/scan-build/ccc-analyzer
===================================================================
--- tools/scan-build/ccc-analyzer
+++ tools/scan-build/ccc-analyzer
@@ -586,7 +586,7 @@
   }
 
   # 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.
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to