diff options
author | Zhongxing Xu <xuzhongxing@gmail.com> | 2008-11-23 05:52:28 +0000 |
---|---|---|
committer | Zhongxing Xu <xuzhongxing@gmail.com> | 2008-11-23 05:52:28 +0000 |
commit | 1c0c23325312df5d40fe788ffcb48484f190e9a3 (patch) | |
tree | dbf3076e8d85fc1b492516d11e13a669a2e9e1c5 /lib/Analysis/GRExprEngineInternalChecks.cpp | |
parent | ea06544bea29ba9def49ea061def1df9e100af25 (diff) |
Add out-of-bound memory access warning report code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59903 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/GRExprEngineInternalChecks.cpp')
-rw-r--r-- | lib/Analysis/GRExprEngineInternalChecks.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/Analysis/GRExprEngineInternalChecks.cpp b/lib/Analysis/GRExprEngineInternalChecks.cpp index b4d4cb2c56..be7282314d 100644 --- a/lib/Analysis/GRExprEngineInternalChecks.cpp +++ b/lib/Analysis/GRExprEngineInternalChecks.cpp @@ -322,6 +322,16 @@ public: } }; +class VISIBILITY_HIDDEN OutOfBoundMemoryAccess : public BuiltinBug { +public: + OutOfBoundMemoryAccess() : BuiltinBug("out-of-bound memory access", + "Load or store into an out-of-bound memory position.") {} + + virtual void EmitBuiltinWarnings(BugReporter& BR, GRExprEngine& Eng) { + Emit(BR, Eng.explicit_oob_memacc_begin(), Eng.explicit_oob_memacc_end()); + } +}; + //===----------------------------------------------------------------------===// // __attribute__(nonnull) checking @@ -392,5 +402,6 @@ void GRExprEngine::RegisterInternalChecks() { Register(new BadArg()); Register(new BadMsgExprArg()); Register(new BadReceiver()); + Register(new OutOfBoundMemoryAccess()); AddCheck(new CheckAttrNonNull(), Stmt::CallExprClass); } |