File tree Expand file tree Collapse file tree 1 file changed +2
-0
lines changed
include/rapidjson/internal Expand file tree Collapse file tree 1 file changed +2
-0
lines changed Original file line number Diff line number Diff line change @@ -113,6 +113,7 @@ class Stack {
113
113
// Expansion is run very infrequently, so it is moved to another (probably non-inline) function.
114
114
template <typename T>
115
115
RAPIDJSON_FORCEINLINE void Reserve (size_t count = 1 ) {
116
+ RAPIDJSON_ASSERT (stackTop_);
116
117
// Expand the stack if needed
117
118
if (RAPIDJSON_UNLIKELY (stackTop_ + sizeof (T) * count > stackEnd_))
118
119
Expand<T>(count);
@@ -126,6 +127,7 @@ class Stack {
126
127
127
128
template <typename T>
128
129
RAPIDJSON_FORCEINLINE T* PushUnsafe (size_t count = 1 ) {
130
+ RAPIDJSON_ASSERT (stackTop_);
129
131
RAPIDJSON_ASSERT (stackTop_ + sizeof (T) * count <= stackEnd_);
130
132
T* ret = reinterpret_cast <T*>(stackTop_);
131
133
stackTop_ += sizeof (T) * count;
You can’t perform that action at this time.
0 commit comments