summaryrefslogtreecommitdiff
path: root/src/mongo/bson
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/bson')
-rw-r--r--src/mongo/bson/bson_validate.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mongo/bson/bson_validate.cpp b/src/mongo/bson/bson_validate.cpp
index 40e824a50fb..e37d09cba20 100644
--- a/src/mongo/bson/bson_validate.cpp
+++ b/src/mongo/bson/bson_validate.cpp
@@ -223,7 +223,7 @@ private:
void _maybePopCodeWithScope(Cursor cursor) {
if constexpr (precise) {
// When ending the scope of a CodeWScope, pop the extra dummy frame and check its size.
- if (_currFrame != _frames.begin() && _currFrame[-1].elem.type() == CodeWScope) {
+ if (_currFrame != _frames.begin() && (_currFrame - 1)->elem.type() == CodeWScope) {
invariant(_popFrame());
uassert(InvalidBSON, "incorrect BSON length", cursor.ptr == _currFrame->end);
}