Commit 03a73910 authored by Milo Yip's avatar Milo Yip Committed by GitHub

Merge pull request #757 from patcheng/feature/fix_clang_warning

added assertion to help suppress clang warnings
parents 369e07d1 95224aff
......@@ -126,6 +126,7 @@ public:
template<typename T>
RAPIDJSON_FORCEINLINE T* PushUnsafe(size_t count = 1) {
RAPIDJSON_ASSERT(stackTop_);
RAPIDJSON_ASSERT(stackTop_ + sizeof(T) * count <= stackEnd_);
T* ret = reinterpret_cast<T*>(stackTop_);
stackTop_ += sizeof(T) * count;
......
......@@ -934,11 +934,13 @@ private:
#else
length = static_cast<SizeType>(__builtin_ffs(r) - 1);
#endif
char* q = reinterpret_cast<char*>(os.Push(length));
for (size_t i = 0; i < length; i++)
q[i] = p[i];
if (length != 0) {
char* q = reinterpret_cast<char*>(os.Push(length));
for (size_t i = 0; i < length; i++)
q[i] = p[i];
p += length;
p += length;
}
break;
}
_mm_storeu_si128(reinterpret_cast<__m128i *>(os.Push(16)), s);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment