Commit 7431dc7e authored by Tudor Bosman's avatar Tudor Bosman Committed by Jordan DeLong

unbreak fbstring<wchar_t> default constructor (!!!)

Test Plan: folly/test/fbstring_test in debug mode

Reviewed By: sdoroshenko@fb.com

FB internal diff: D661622
parent 2271234d
...@@ -274,7 +274,7 @@ public: ...@@ -274,7 +274,7 @@ public:
fbstring_core() { fbstring_core() {
// Only initialize the tag, will set the MSBs (i.e. the small // Only initialize the tag, will set the MSBs (i.e. the small
// string size) to zero too // string size) to zero too
ml_.capacity_ = maxSmallSize << (8 * (sizeof(size_t) - 1)); ml_.capacity_ = maxSmallSize << (8 * (sizeof(size_t) - sizeof(Char)));
// or: setSmallSize(0); // or: setSmallSize(0);
writeTerminator(); writeTerminator();
assert(category() == isSmall && size() == 0); assert(category() == isSmall && size() == 0);
......
...@@ -993,6 +993,11 @@ TEST(FBString, testFixedBugs) { ...@@ -993,6 +993,11 @@ TEST(FBString, testFixedBugs) {
cp += "bb"; cp += "bb";
} }
} }
{
// D661622
basic_fbstring<wchar_t> s;
EXPECT_EQ(0, s.size());
}
} }
......
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