Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: compiled/String.h

Issue 29669631: Noissue - Zero size OwnedString should be INVALID (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Created Jan. 15, 2018, 10:24 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: compiled/String.h
===================================================================
--- a/compiled/String.h
+++ b/compiled/String.h
@@ -276,17 +276,17 @@
OwnedString newValue(length() + additionalSize);
if (length() > 0)
std::memcpy(newValue.mBuf, mBuf, sizeof(value_type) * length());
*this = std::move(newValue);
}
public:
explicit OwnedString(size_type len = 0)
- : String(nullptr, len, READ_WRITE)
+ : String(nullptr, len, len ? READ_WRITE : INVALID)
{
if (len)
{
mBuf = new value_type[length()];
annotate_address(mBuf, "String");
}
else
mBuf = nullptr;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld