summaryrefslogtreecommitdiff
path: root/src/mongo/bson/bsonobjbuilder.cpp
diff options
context:
space:
mode:
authorADAM David Alan Martin <adam.martin@10gen.com>2019-07-26 15:04:05 -0400
committerADAM David Alan Martin <adam.martin@10gen.com>2019-07-26 15:04:05 -0400
commit5090e4efc24b88d28fa83d30457e1d097f2fc273 (patch)
tree5b7f54a544121446b0b012f9b0f6c5443aae859b /src/mongo/bson/bsonobjbuilder.cpp
parentc44cf6f5f299991ec6819b5933b081476dc65a27 (diff)
downloadmongo-5090e4efc24b88d28fa83d30457e1d097f2fc273.tar.gz
SERVER-41989 Fix exception safety in `BSONObjBuilder::asTempObj`.
The setting of `_doneCalled` too early allows for it to remain set after an exception is thrown. This will cause invariant violations under some conditions.
Diffstat (limited to 'src/mongo/bson/bsonobjbuilder.cpp')
-rw-r--r--src/mongo/bson/bsonobjbuilder.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mongo/bson/bsonobjbuilder.cpp b/src/mongo/bson/bsonobjbuilder.cpp
index e2d56cb540e..369f307beb4 100644
--- a/src/mongo/bson/bsonobjbuilder.cpp
+++ b/src/mongo/bson/bsonobjbuilder.cpp
@@ -239,7 +239,7 @@ BSONObjBuilder::~BSONObjBuilder() {
}
template <typename Alloc>
-void _BufBuilder<Alloc>::grow_reallocate(int minSize) {
+void BasicBufBuilder<Alloc>::grow_reallocate(int minSize) {
if (minSize > BufferMaxSize) {
std::stringstream ss;
ss << "BufBuilder attempted to grow() to " << minSize << " bytes, past the 64MB limit.";
@@ -254,8 +254,8 @@ void _BufBuilder<Alloc>::grow_reallocate(int minSize) {
size = a;
}
-template class _BufBuilder<SharedBufferAllocator>;
-template class _BufBuilder<StackAllocator>;
+template class BasicBufBuilder<SharedBufferAllocator>;
+template class BasicBufBuilder<StackAllocator>;
template class StringBuilderImpl<SharedBufferAllocator>;
template class StringBuilderImpl<StackAllocator>;