projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e39f033
)
Add an assertion check to raw_ostream's destructor to verify
author
Dan Gohman
<gohman@apple.com>
Mon, 27 Jul 2009 20:49:44 +0000
(20:49 +0000)
committer
Dan Gohman
<gohman@apple.com>
Mon, 27 Jul 2009 20:49:44 +0000
(20:49 +0000)
that the subclass hasn't left any pending data in the buffer.
llvm-svn: 77245
llvm/lib/Support/raw_ostream.cpp
patch
|
blob
|
history
diff --git
a/llvm/lib/Support/raw_ostream.cpp
b/llvm/lib/Support/raw_ostream.cpp
index
3cec18b
..
7e34e06
100644
(file)
--- a/
llvm/lib/Support/raw_ostream.cpp
+++ b/
llvm/lib/Support/raw_ostream.cpp
@@
-45,6
+45,11
@@
using namespace llvm;
raw_ostream::~raw_ostream() {
+ // raw_ostream's subclasses should take care to flush the buffer
+ // in their destructors.
+ assert(OutBufCur == OutBufStart &&
+ "raw_ostream destructor called with non-empty buffer!");
+
delete [] OutBufStart;
// If there are any pending errors, report them now. Clients wishing