scanf analysis: handle scanlists that start with ^] (PR19559)

llvm-svn: 207573
This commit is contained in:
Hans Wennborg
2014-04-29 19:42:27 +00:00
parent 1a3f18b161
commit df51ee6c50
2 changed files with 14 additions and 0 deletions

View File

@@ -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) {