aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/SplitVector.h
diff options
context:
space:
mode:
authorNeil Hodgson <nyamatongwe@gmail.com>2015-07-04 08:51:08 +1000
committerNeil Hodgson <nyamatongwe@gmail.com>2015-07-04 08:51:08 +1000
commit508e2c9c45b3f68a8c8ac32878bdede0d07bfa52 (patch)
tree969e556659b350f417d179123b76387176331047 /src/SplitVector.h
parent6852a57b20e1a514e6c504e8f0bed0114eb0dfba (diff)
downloadscintilla-mirror-508e2c9c45b3f68a8c8ac32878bdede0d07bfa52.tar.gz
Throw an exception for a negative sized reallocation as occurs when asked
for more than 2GB.
Diffstat (limited to 'src/SplitVector.h')
-rw-r--r--src/SplitVector.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/SplitVector.h b/src/SplitVector.h
index 288c9e39f..3153700f5 100644
--- a/src/SplitVector.h
+++ b/src/SplitVector.h
@@ -85,6 +85,9 @@ public:
/// copy exisiting contents to the new buffer.
/// Must not be used to decrease the size of the buffer.
void ReAllocate(int newSize) {
+ if (newSize < 0)
+ throw std::runtime_error("SplitVector::ReAllocate: negative size.");
+
if (newSize > size) {
// Move the gap to the end
GapTo(lengthBody);