Skip to content

Commit 81c0947

Browse files
committed
---
yaml --- r: 347021 b: refs/heads/master c: 65eca49 h: refs/heads/master i: 347019: 2ab6e4a
1 parent 9c49a1a commit 81c0947

File tree

6 files changed

+34
-14
lines changed

6 files changed

+34
-14
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: fc8ae264133980bae8ddc1b094d0e89e9303fd5e
2+
refs/heads/master: 65eca497ce1a79184b22306351a89a05f57a4236
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/MetadataReader.h

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2472,8 +2472,13 @@ class MetadataReader {
24722472
TaggedPointerExtendedClasses =
24732473
TaggedPointerExtendedClassesAddr.getAddressData();
24742474

2475-
tryFindAndReadSymbol(TaggedPointerObfuscator,
2476-
"objc_debug_taggedpointer_obfuscator");
2475+
// The tagged pointer obfuscator is not present on older OSes, in
2476+
// which case we can treat it as zero.
2477+
TaggedPointerObfuscator = 0;
2478+
auto TaggedPointerObfuscatorAddr = Reader->getSymbolAddress(
2479+
"objc_debug_taggedpointer_obfuscator");
2480+
if (TaggedPointerObfuscatorAddr)
2481+
tryReadSymbol(TaggedPointerObfuscatorAddr, TaggedPointerObfuscator);
24772482

24782483
# undef tryFindSymbol
24792484
# undef tryReadSymbol

trunk/lib/Sema/TypeCheckDeclOverride.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -861,7 +861,7 @@ static void checkOverrideAccessControl(ValueDecl *baseDecl, ValueDecl *decl,
861861
}
862862
} else if (baseHasOpenAccess &&
863863
classDecl->hasOpenAccess(dc) &&
864-
decl->getFormalAccess() != AccessLevel::Open &&
864+
decl->getFormalAccess() < AccessLevel::Public &&
865865
!decl->isFinal()) {
866866
{
867867
auto diag = diags.diagnose(decl, diag::override_not_accessible,

trunk/stdlib/tools/swift-reflection-test/swift-reflection-test.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,14 @@ static void errnoAndExit(const char *message) {
6666
abort();
6767
}
6868

69+
#if 0
70+
#include <inttypes.h>
71+
#define DEBUG_LOG(fmt, ...) fprintf(stderr, "%s: " fmt "\n",\
72+
__func__, __VA_ARGS__)
73+
#else
74+
#define DEBUG_LOG(fmt, ...) (void)0
75+
#endif
76+
6977
static const size_t ReadEnd = 0;
7078
static const size_t WriteEnd = 1;
7179

@@ -143,6 +151,8 @@ const void *PipeMemoryReader_readBytes(void *Context, swift_addr_t Address,
143151
const PipeMemoryReader *Reader = (const PipeMemoryReader *)Context;
144152
uintptr_t TargetAddress = Address;
145153
size_t TargetSize = (size_t)Size;
154+
DEBUG_LOG("Requesting read of %zu bytes from 0x%" PRIxPTR,
155+
TargetSize, TargetAddress);
146156
int WriteFD = PipeMemoryReader_getParentWriteFD(Reader);
147157
write(WriteFD, REQUEST_READ_BYTES, 2);
148158
write(WriteFD, &TargetAddress, sizeof(TargetAddress));
@@ -162,12 +172,14 @@ swift_addr_t PipeMemoryReader_getSymbolAddress(void *Context,
162172
uint64_t Length) {
163173
const PipeMemoryReader *Reader = (const PipeMemoryReader *)Context;
164174
uintptr_t Address = 0;
175+
DEBUG_LOG("Requesting address of symbol %s", SymbolName);
165176
int WriteFD = PipeMemoryReader_getParentWriteFD(Reader);
166177
write(WriteFD, REQUEST_SYMBOL_ADDRESS, 2);
167178
write(WriteFD, SymbolName, Length);
168179
write(WriteFD, "\n", 1);
169180
PipeMemoryReader_collectBytesFromPipe(Reader, (uint8_t*)&Address,
170181
sizeof(Address));
182+
DEBUG_LOG("Address of %s is 0x%" PRIxPTR, SymbolName, Address);
171183
return (uintptr_t)Address;
172184
}
173185

@@ -177,6 +189,7 @@ PipeMemoryReader_receiveInstanceKind(const PipeMemoryReader *Reader) {
177189
write(WriteFD, REQUEST_INSTANCE_KIND, 2);
178190
uint8_t KindValue = 0;
179191
PipeMemoryReader_collectBytesFromPipe(Reader, &KindValue, sizeof(KindValue));
192+
DEBUG_LOG("Requested instance kind is %u", KindValue);
180193
return KindValue;
181194
}
182195

@@ -187,6 +200,7 @@ PipeMemoryReader_receiveInstanceAddress(const PipeMemoryReader *Reader) {
187200
uintptr_t InstanceAddress = 0;
188201
PipeMemoryReader_collectBytesFromPipe(Reader, (uint8_t *)&InstanceAddress,
189202
sizeof(InstanceAddress));
203+
DEBUG_LOG("Requested instance address is 0x%" PRIxPTR, InstanceAddress);
190204
return InstanceAddress;
191205
}
192206

@@ -222,6 +236,7 @@ PipeMemoryReader_receiveImages(SwiftReflectionContextRef RC,
222236
size_t NumReflectionInfos;
223237
PipeMemoryReader_collectBytesFromPipe(Reader, &NumReflectionInfos,
224238
sizeof(NumReflectionInfos));
239+
DEBUG_LOG("Receiving %z images from child", NumReflectionInfos);
225240

226241
if (NumReflectionInfos == 0)
227242
return;
@@ -232,6 +247,7 @@ PipeMemoryReader_receiveImages(SwiftReflectionContextRef RC,
232247
NumReflectionInfos * sizeof(*Images));
233248

234249
for (size_t i = 0; i < NumReflectionInfos; ++i) {
250+
DEBUG_LOG("Adding image at 0x%" PRIxPTR, Images[i].Start);
235251
swift_reflection_addImage(RC, Images[i].Start);
236252
}
237253

trunk/test/attr/open.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,16 +76,16 @@ class SubClass : ExternalOpenClass {
7676
}
7777
}
7878

79-
open class InvalidOpenSubClass : ExternalOpenClass {
80-
public override func openMethod() {} // expected-error {{overriding instance method must be as accessible as the declaration it overrides}} {{3-9=open}}
81-
public override var openProperty: Int { get{return 0} set{} } // expected-error {{overriding property must be as accessible as the declaration it overrides}} {{3-9=open}}
82-
public override subscript(index: MarkerForOpenSubscripts) -> Int { // expected-error {{overriding subscript must be as accessible as the declaration it overrides}} {{3-9=open}}
79+
open class ValidOpenSubClass : ExternalOpenClass {
80+
public override func openMethod() {}
81+
public override var openProperty: Int { get{return 0} set{} }
82+
public override subscript(index: MarkerForOpenSubscripts) -> Int {
8383
get { return 0 }
8484
set {}
8585
}
8686
}
8787

88-
open class InvalidOpenSubClass2 : ExternalOpenClass {
88+
open class InvalidOpenSubClass : ExternalOpenClass {
8989
internal override func openMethod() {} // expected-error {{overriding instance method must be as accessible as the declaration it overrides}} {{3-11=open}}
9090
internal override var openProperty: Int { get{return 0} set{} } // expected-error {{overriding property must be as accessible as the declaration it overrides}} {{3-11=open}}
9191
internal override subscript(index: MarkerForOpenSubscripts) -> Int { // expected-error {{overriding subscript must be as accessible as the declaration it overrides}} {{3-11=open}}

trunk/test/decl/class/override.swift

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -362,10 +362,9 @@ class DerivedWithFilePrivateSetter: BaseWithFilePrivateSetter {
362362
}
363363
}
364364

365-
// Issues with final overrides of open members
366365
open class OpenBase {
367-
open func instanceMethod() {} // expected-note {{overridden declaration is here}}
368-
open class func classMethod() {} // expected-note {{overridden declaration is here}}
366+
open func instanceMethod() {}
367+
open class func classMethod() {}
369368
}
370369

371370
public class PublicDerived : OpenBase {
@@ -379,8 +378,8 @@ open class OpenDerived : OpenBase {
379378
}
380379

381380
open class OpenDerivedPublic : OpenBase {
382-
override public func instanceMethod() {} // expected-error {{overriding instance method must be as accessible as the declaration it overrides}}
383-
override public class func classMethod() {} // expected-error {{overriding class method must be as accessible as the declaration it overrides}}
381+
override public func instanceMethod() {} // Ok
382+
override public class func classMethod() {} // Ok
384383
}
385384

386385
open class OpenDerivedFinal : OpenBase {

0 commit comments

Comments
 (0)