Index: compiled/String.h |
=================================================================== |
--- a/compiled/String.h |
+++ b/compiled/String.h |
@@ -290,17 +290,19 @@ |
} |
else |
mBuf = nullptr; |
} |
explicit OwnedString(const String& str) |
: OwnedString(str.length()) |
{ |
- if (length()) |
+ if (!str.is_invalid() && !length()) |
+ mLen = length() | READ_WRITE; |
+ else if (length()) |
std::memcpy(mBuf, str.mBuf, sizeof(value_type) * length()); |
} |
OwnedString(const OwnedString& str) |
: OwnedString(static_cast<const String&>(str)) |
{ |
} |