[PATCH] D13800: ccc-analyzer: Fix -isystem value passing

Peter Wu via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 16 03:46:58 PDT 2015


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.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D13800.37567.patch
Type: text/x-patch
Size: 406 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20151016/28d446e2/attachment.bin>


More information about the cfe-commits mailing list