projects
/
oota-llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0ba50bb
)
Add an assert to check copy_to_buffer's precondition.
author
Dan Gohman
<gohman@apple.com>
Thu, 13 Aug 2009 18:38:15 +0000
(18:38 +0000)
committer
Dan Gohman
<gohman@apple.com>
Thu, 13 Aug 2009 18:38:15 +0000
(18:38 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78926
91177308
-0d34-0410-b5e6-
96231b3b80d8
lib/Support/raw_ostream.cpp
patch
|
blob
|
history
diff --git
a/lib/Support/raw_ostream.cpp
b/lib/Support/raw_ostream.cpp
index 5eaf7bf6a04e395ef24ca37b4160f7cc62dd83cf..3ea5c9af8358cd15cdc6d3fffb9060a7f116983b 100644
(file)
--- a/
lib/Support/raw_ostream.cpp
+++ b/
lib/Support/raw_ostream.cpp
@@
-222,6
+222,8
@@
raw_ostream &raw_ostream::write(const char *Ptr, size_t Size) {
}
void raw_ostream::copy_to_buffer(const char *Ptr, size_t Size) {
+ assert(Size <= OutBufEnd - OutBufCur && "Buffer overrun!");
+
// Handle short strings specially, memcpy isn't very good at very short
// strings.
switch (Size) {