diff options
Diffstat (limited to 'lib/Analysis/GRExprEngineInternalChecks.cpp')
-rw-r--r-- | lib/Analysis/GRExprEngineInternalChecks.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/Analysis/GRExprEngineInternalChecks.cpp b/lib/Analysis/GRExprEngineInternalChecks.cpp index cc5762267b..b4d4cb2c56 100644 --- a/lib/Analysis/GRExprEngineInternalChecks.cpp +++ b/lib/Analysis/GRExprEngineInternalChecks.cpp @@ -180,7 +180,7 @@ public: } } }; - + class VISIBILITY_HIDDEN RetStack : public BuiltinBug { public: RetStack() : BuiltinBug("return of stack address") {} @@ -239,7 +239,16 @@ public: } } }; - + +class VISIBILITY_HIDDEN RetUndef : public BuiltinBug { +public: + RetUndef() : BuiltinBug("uninitialized return value", + "Uninitialized or undefined return value returned to caller.") {} + + virtual void EmitBuiltinWarnings(BugReporter& BR, GRExprEngine& Eng) { + Emit(BR, Eng.ret_undef_begin(), Eng.ret_undef_end()); + } +}; class VISIBILITY_HIDDEN UndefBranch : public BuiltinBug { struct VISIBILITY_HIDDEN FindUndefExpr { @@ -379,6 +388,7 @@ void GRExprEngine::RegisterInternalChecks() { Register(new UndefResult()); Register(new BadCall()); Register(new RetStack()); + Register(new RetUndef()); Register(new BadArg()); Register(new BadMsgExprArg()); Register(new BadReceiver()); |