diff options
author | Ted Kremenek <kremenek@apple.com> | 2010-08-24 22:24:51 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2010-08-24 22:24:51 +0000 |
commit | 9325eaf08fcccbc0d038e703f570c64daacdaa31 (patch) | |
tree | 3fe0fad021235b1707690aa05f1b0ceabe5f5cde /lib/Analysis/PrintfFormatString.cpp | |
parent | 4020f8703a8822fe0d4efe4a0dc74f0b8040bd9f (diff) |
Fix printf format string checking for '%lc' (which expects a wint_t or compatible argument). Fixes PR 7981.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111978 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/PrintfFormatString.cpp')
-rw-r--r-- | lib/Analysis/PrintfFormatString.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/Analysis/PrintfFormatString.cpp b/lib/Analysis/PrintfFormatString.cpp index 727de2934f..b8c327cdeb 100644 --- a/lib/Analysis/PrintfFormatString.cpp +++ b/lib/Analysis/PrintfFormatString.cpp @@ -281,6 +281,14 @@ ArgTypeResult PrintfSpecifier::getArgType(ASTContext &Ctx) const { if (!CS.consumesDataArgument()) return ArgTypeResult::Invalid(); + if (CS.getKind() == ConversionSpecifier::cArg) + switch (LM.getKind()) { + case LengthModifier::None: return Ctx.IntTy; + case LengthModifier::AsLong: return ArgTypeResult::WIntTy; + default: + return ArgTypeResult::Invalid(); + } + if (CS.isIntArg()) switch (LM.getKind()) { case LengthModifier::AsLongDouble: |