Skip to content

Commit b206bd6

Browse files
committed
[ABI] Fix encoding of new generic environments metadata.
A paste-o in GenericEnvironmentFlags meant we didn’t have well-formed metadata.
1 parent cdd2928 commit b206bd6

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

include/swift/ABI/MetadataValues.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1530,7 +1530,7 @@ class GenericEnvironmentFlags {
15301530

15311531
constexpr GenericEnvironmentFlags
15321532
withNumGenericRequirements(uint16_t numGenericRequirements) const {
1533-
return GenericEnvironmentFlags((Value &~ NumGenericParameterLevelsMask)
1533+
return GenericEnvironmentFlags((Value &~ NumGenericRequirementsMask)
15341534
| (numGenericRequirements << NumGenericRequirementsShift));
15351535
}
15361536

test/IRGen/keypaths.sil

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ sil_vtable C2 {}
206206
// CHECK-64-SAME: i32 36 }>
207207

208208
// CHECK-LABEL: @"generic environment SHRzSHR_r0_l" = linkonce_odr hidden constant
209-
// CHECK-SAME: i32 8192, i16 2, i8 -128, i8 -128, i32 128
209+
// CHECK-SAME: i32 8193, i16 2, i8 -128, i8 -128, i32 128
210210

211211
// -- %t
212212
// CHECK: [[KP_T:@keypath(\..*)?]] = private global <{ {{.*}} }> <{ {{.*}} i32 1, {{.*}} @"got.$s8keypaths1GV1xxvpMV"

0 commit comments

Comments
 (0)