Commit 95224aff authored by Patrick Cheng's avatar Patrick Cheng

When length is 0, the code does nothing, so skip it completely.

Previously, os.Push(0) would do nothing as well. But with the newly added assertion, is the stack is empty, it will fail the assertion.
parent 91a803d4
...@@ -948,11 +948,13 @@ private: ...@@ -948,11 +948,13 @@ private:
#else #else
length = static_cast<SizeType>(__builtin_ffs(r) - 1); length = static_cast<SizeType>(__builtin_ffs(r) - 1);
#endif #endif
char* q = reinterpret_cast<char*>(os.Push(length)); if (length != 0) {
for (size_t i = 0; i < length; i++) char* q = reinterpret_cast<char*>(os.Push(length));
q[i] = p[i]; for (size_t i = 0; i < length; i++)
q[i] = p[i];
p += length; p += length;
}
break; break;
} }
_mm_storeu_si128(reinterpret_cast<__m128i *>(os.Push(16)), s); _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