Skip to content

Commit c10adcc

Browse files
committed
---
yaml --- r: 348767 b: refs/heads/master c: 263bbbb h: refs/heads/master i: 348765: 1bdb58e 348763: af7d7ca 348759: 318cda4 348751: ef426a7 348735: 792944a
1 parent 3dc5dba commit c10adcc

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 5d3ee68f9ce112a5f9401d3b378b24541042bbbd
2+
refs/heads/master: 263bbbb8392340ed427c043e08d4eb4a3b768219
33
refs/heads/master-next: 203b3026584ecad859eb328b2e12490099409cd5
44
refs/tags/osx-passed: b6b74147ef8a386f532cf9357a1bde006e552c54
55
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-a: 6bb18e013c2284f2b45f5f84f2df2887dc0f7dea

trunk/include/swift/Remote/CMemoryReader.h

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,13 @@ class CMemoryReader final : public MemoryReader {
6666

6767
bool readString(RemoteAddress address, std::string &dest) override {
6868
auto length = getStringLength(address);
69-
if (!length)
70-
return false;
69+
if (length == 0) {
70+
// A length of zero unfortunately might mean either that there's a zero
71+
// length string at the location we're trying to read, or that reading
72+
// failed. We can do a one-byte read to tell them apart.
73+
auto buf = readBytes(address, 1);
74+
return buf && ((const char*)buf.get())[0] == 0;
75+
}
7176

7277
auto Buf = readBytes(address, length);
7378
if (!Buf)

0 commit comments

Comments
 (0)