[cfe-commits] r108900 - in /cfe/trunk: include/clang/Analysis/Analyses/FormatString.h lib/Analysis/PrintfFormatString.cpp lib/Analysis/ScanfFormatString.cpp lib/Sema/SemaChecking.cpp
Ted Kremenek
kremenek at apple.com
Tue Jul 20 13:04:10 PDT 2010
Author: kremenek
Date: Tue Jul 20 15:04:10 2010
New Revision: 108900
URL: http://llvm.org/viewvc/llvm-project?rev=108900&view=rev
Log:
Rename 'ConsumedSoFarArg' -> 'nArg' and 'OutIntPtrArg' to 'nArg' (scanf and printf checking).
Modified:
cfe/trunk/include/clang/Analysis/Analyses/FormatString.h
cfe/trunk/lib/Analysis/PrintfFormatString.cpp
cfe/trunk/lib/Analysis/ScanfFormatString.cpp
cfe/trunk/lib/Sema/SemaChecking.cpp
Modified: cfe/trunk/include/clang/Analysis/Analyses/FormatString.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Analysis/Analyses/FormatString.h?rev=108900&r1=108899&r2=108900&view=diff
==============================================================================
--- cfe/trunk/include/clang/Analysis/Analyses/FormatString.h (original)
+++ cfe/trunk/include/clang/Analysis/Analyses/FormatString.h Tue Jul 20 15:04:10 2010
@@ -273,9 +273,9 @@
GArg, // 'G',
aArg, // 'a',
AArg, // 'A',
- sArg, // 's'
- pArg, // 'p'
- OutIntPtrArg, // 'n'
+ sArg, // 's'
+ pArg, // 'p'
+ nArg, // 'n'
PercentArg, // '%'
// MacOS X unicode extensions.
CArg, // 'C'
@@ -465,7 +465,7 @@
sArg, // 's', // match sequence of non-write-space characters
pArg, // 'p'
cArg, // 'c', differs from printf, writes array of characters
- ConsumedSoFarArg, // 'n', differs from printf, writes back args consumed
+ nArg, // 'n', differs from printf, writes back args consumed
PercentArg, // '%'
ScanListArg, // '[' followed by scan list
// IEEE Std 1003.1 extensions.
Modified: cfe/trunk/lib/Analysis/PrintfFormatString.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/PrintfFormatString.cpp?rev=108900&r1=108899&r2=108900&view=diff
==============================================================================
--- cfe/trunk/lib/Analysis/PrintfFormatString.cpp (original)
+++ cfe/trunk/lib/Analysis/PrintfFormatString.cpp Tue Jul 20 15:04:10 2010
@@ -178,7 +178,7 @@
case 'f': k = ConversionSpecifier::fArg; break;
case 'g': k = ConversionSpecifier::gArg; break;
case 'i': k = ConversionSpecifier::iArg; break;
- case 'n': k = ConversionSpecifier::OutIntPtrArg; break;
+ case 'n': k = ConversionSpecifier::nArg; break;
case 'o': k = ConversionSpecifier::oArg; break;
case 'p': k = ConversionSpecifier::pArg; break;
case 's': k = ConversionSpecifier::sArg; break;
@@ -252,7 +252,7 @@
case cArg: return "c";
case sArg: return "s";
case pArg: return "p";
- case OutIntPtrArg: return "n";
+ case nArg: return "n";
case PercentArg: return "%";
case InvalidSpecifier: return NULL;
@@ -550,7 +550,7 @@
// The left justified flag is valid for all conversions except n
switch (CS.getKind()) {
- case ConversionSpecifier::OutIntPtrArg:
+ case ConversionSpecifier::nArg:
return false;
default:
@@ -577,7 +577,7 @@
case ConversionSpecifier::uArg:
case ConversionSpecifier::xArg:
case ConversionSpecifier::XArg:
- case ConversionSpecifier::OutIntPtrArg:
+ case ConversionSpecifier::nArg:
return true;
default:
return false;
@@ -600,7 +600,7 @@
case ConversionSpecifier::EArg:
case ConversionSpecifier::gArg:
case ConversionSpecifier::GArg:
- case ConversionSpecifier::OutIntPtrArg:
+ case ConversionSpecifier::nArg:
case ConversionSpecifier::cArg:
case ConversionSpecifier::sArg:
return true;
@@ -659,7 +659,7 @@
// The field width is valid for all conversions except n
switch (CS.getKind()) {
- case ConversionSpecifier::OutIntPtrArg:
+ case ConversionSpecifier::nArg:
return false;
default:
Modified: cfe/trunk/lib/Analysis/ScanfFormatString.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/ScanfFormatString.cpp?rev=108900&r1=108899&r2=108900&view=diff
==============================================================================
--- cfe/trunk/lib/Analysis/ScanfFormatString.cpp (original)
+++ cfe/trunk/lib/Analysis/ScanfFormatString.cpp Tue Jul 20 15:04:10 2010
@@ -158,7 +158,7 @@
case 'f': k = ConversionSpecifier::fArg; break;
case 'g': k = ConversionSpecifier::gArg; break;
case 'i': k = ConversionSpecifier::iArg; break;
- case 'n': k = ConversionSpecifier::ConsumedSoFarArg; break;
+ case 'n': k = ConversionSpecifier::nArg; break;
case 'c': k = ConversionSpecifier::cArg; break;
case 'C': k = ConversionSpecifier::CArg; break;
case 'S': k = ConversionSpecifier::SArg; break;
Modified: cfe/trunk/lib/Sema/SemaChecking.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaChecking.cpp?rev=108900&r1=108899&r2=108900&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaChecking.cpp (original)
+++ cfe/trunk/lib/Sema/SemaChecking.cpp Tue Jul 20 15:04:10 2010
@@ -1525,7 +1525,7 @@
LM.getLength()));
// Are we using '%n'?
- if (CS.getKind() == ConversionSpecifier::OutIntPtrArg) {
+ if (CS.getKind() == ConversionSpecifier::nArg) {
// Issue a warning about this being a possible security issue.
S.Diag(getLocationOfByte(CS.getStart()), diag::warn_printf_write_back)
<< getSpecifierRange(startSpecifier, specifierLen);
More information about the cfe-commits
mailing list