diff options
| author | Hans Wennborg <hans@hanshq.net> | 2014-04-29 19:42:27 +0000 |
|---|---|---|
| committer | Hans Wennborg <hans@hanshq.net> | 2014-04-29 19:42:27 +0000 |
| commit | 4bfadd950fedac9629712ae5584319849896a85d (patch) | |
| tree | c99162f28c2f289656c4b551a8045173945bac98 /lib/Analysis/ScanfFormatString.cpp | |
| parent | ebbe39ffbe9af1fb0d541990352218320cf28466 (diff) | |
| download | clang-4bfadd950fedac9629712ae5584319849896a85d.tar.gz clang-4bfadd950fedac9629712ae5584319849896a85d.tar.bz2 clang-4bfadd950fedac9629712ae5584319849896a85d.tar.xz | |
scanf analysis: handle scanlists that start with ^] (PR19559)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207573 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/ScanfFormatString.cpp')
| -rw-r--r-- | lib/Analysis/ScanfFormatString.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/Analysis/ScanfFormatString.cpp b/lib/Analysis/ScanfFormatString.cpp index 3ff7f0ad2e..18505e263b 100644 --- a/lib/Analysis/ScanfFormatString.cpp +++ b/lib/Analysis/ScanfFormatString.cpp @@ -50,6 +50,15 @@ static bool ParseScanList(FormatStringHandler &H, } } + // Special case: "]^" are the first characters. + if (I + 1 != E && I[0] == '^' && I[1] == ']') { + I += 2; + if (I == E) { + H.HandleIncompleteScanList(start, I - 1); + return true; + } + } + // Look for a ']' character which denotes the end of the scan list. while (*I != ']') { if (++I == E) { |
