File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed
trunk/include/swift/Remote Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change 1
1
---
2
- refs/heads/master: 5d3ee68f9ce112a5f9401d3b378b24541042bbbd
2
+ refs/heads/master: 263bbbb8392340ed427c043e08d4eb4a3b768219
3
3
refs/heads/master-next: 203b3026584ecad859eb328b2e12490099409cd5
4
4
refs/tags/osx-passed: b6b74147ef8a386f532cf9357a1bde006e552c54
5
5
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-a: 6bb18e013c2284f2b45f5f84f2df2887dc0f7dea
Original file line number Diff line number Diff line change @@ -66,8 +66,13 @@ class CMemoryReader final : public MemoryReader {
66
66
67
67
bool readString (RemoteAddress address, std::string &dest) override {
68
68
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
+ }
71
76
72
77
auto Buf = readBytes (address, length);
73
78
if (!Buf)
You can’t perform that action at this time.
0 commit comments