diff options
author | Tom Care <tcare@apple.com> | 2010-06-17 19:00:27 +0000 |
---|---|---|
committer | Tom Care <tcare@apple.com> | 2010-06-17 19:00:27 +0000 |
commit | b49ec6907b32dfa75c71c8c468b0f88629b74a9f (patch) | |
tree | 4dc4ab19a88723b087d9d71904fe3da6687f3d90 /llvm/lib/CodeGen/MachineBasicBlock.cpp | |
parent | 0ed5b460dc6e4a1f1f2a2f2680b54e438b55fcc8 (diff) | |
download | llvm-b49ec6907b32dfa75c71c8c468b0f88629b74a9f.zip llvm-b49ec6907b32dfa75c71c8c468b0f88629b74a9f.tar.gz llvm-b49ec6907b32dfa75c71c8c468b0f88629b74a9f.tar.bz2 |
Bug 7377: Fixed several bad printf format string bugs.
- Added warning for undefined behavior when using field specifier
- Added warning for undefined behavior when using length modifier
- Fixed warnings for invalid flags
- Added warning for ignored flags
- Added fixits for the above warnings
- Fixed accuracy of detecting several undefined behavior conditions
- Receive normal warnings in addition to security warnings when using %n
- Fix bug where '+' flag would remain on unsigned conversion suggestions
Summary of changes:
- Added expanded tests
- Added/expanded warnings
- Added position info to OptionalAmounts for fixits
- Extracted optional flags to a wrapper class with position info for fixits
- Added several methods to validate a FormatSpecifier by component, each checking for undefined behavior
- Fixed conversion specifier checking to conform to C99 standard
- Added hooks to detect the invalid states in CheckPrintfHandler::HandleFormatSpecifier
Note: warnings involving the ' ' (space) flag are temporarily disabled until whitespace highlighting no longer triggers assertions. I will make a post about this on cfe-dev shortly.
M test/Sema/format-strings.c
M include/clang/Basic/DiagnosticSemaKinds.td
M include/clang/Analysis/Analyses/PrintfFormatString.h
M lib/Analysis/PrintfFormatString.cpp
M lib/Sema/SemaChecking.cpp
llvm-svn: 106233
Diffstat (limited to 'llvm/lib/CodeGen/MachineBasicBlock.cpp')
0 files changed, 0 insertions, 0 deletions