Skip to content

Commit 2375b64

Browse files
committed
---
yaml --- r: 345947 b: refs/heads/master c: a86313f h: refs/heads/master i: 345945: 6a6f955 345943: 570c26c
1 parent 78a8c4c commit 2375b64

File tree

5 files changed

+10
-4
lines changed

5 files changed

+10
-4
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: e03b4a13879fcd9a2c0093c9630ae825bd3ac75e
2+
refs/heads/master: a86313f1291d0c1ef78ad5ce749dd24a3e898e19
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/lib/IRGen/GenKeyPath.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -691,6 +691,7 @@ emitGeneratorForKeyPath(IRGenModule &IGM,
691691
// Form the mangled name with its relative reference.
692692
auto S = B.beginStruct();
693693
S.setPacked(true);
694+
S.add(llvm::ConstantInt::get(IGM.Int8Ty, 255));
694695
S.add(llvm::ConstantInt::get(IGM.Int8Ty, 9));
695696
S.addRelativeAddress(accessorThunk);
696697

trunk/lib/IRGen/GenReflection.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@ llvm::Constant *IRGenModule::getMangledAssociatedConformance(
217217
ConstantInitBuilder B(*this);
218218
auto S = B.beginStruct();
219219
S.setPacked(true);
220+
S.add(llvm::ConstantInt::get(Int8Ty, 255));
220221
S.add(llvm::ConstantInt::get(Int8Ty, kind));
221222
S.addRelativeAddress(accessor);
222223

trunk/stdlib/public/core/KeyPath.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2410,15 +2410,16 @@ internal func _resolveKeyPathGenericArgReference(_ reference: UnsafeRawPointer,
24102410

24112411
// If we have a symbolic reference to an accessor, call it.
24122412
let first = referenceStart.load(as: UInt8.self)
2413-
if first == 9 {
2413+
if first == 255 && reference.load(as: UInt8.self) == 9 {
24142414
typealias MetadataAccessor =
24152415
@convention(c) (UnsafeRawPointer) -> UnsafeRawPointer
24162416

24172417
// Unaligned load of the offset.
2418+
let pointerReference = reference + 1
24182419
var offset: Int32 = 0
2419-
_memcpy(dest: &offset, src: reference, size: 4)
2420+
_memcpy(dest: &offset, src: pointerReference, size: 4)
24202421

2421-
let accessorPtr = _resolveRelativeAddress(reference, offset)
2422+
let accessorPtr = _resolveRelativeAddress(pointerReference, offset)
24222423
let accessor = unsafeBitCast(accessorPtr, to: MetadataAccessor.self)
24232424
return accessor(arguments)
24242425
}

trunk/stdlib/public/runtime/Metadata.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4227,6 +4227,9 @@ static const WitnessTable *swift_getAssociatedConformanceWitnessSlowImpl(
42274227

42284228

42294229
// Extract the mangled name itself.
4230+
if (*mangledNameBase == '\xFF')
4231+
++mangledNameBase;
4232+
42304233
StringRef mangledName =
42314234
Demangle::makeSymbolicMangledNameStringRef(mangledNameBase);
42324235

0 commit comments

Comments
 (0)