Skip to content

Commit f431e00

Browse files
committed
Fix abi test for new initRaw runtime function
1 parent 3d8a9d4 commit f431e00

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

include/swift/Runtime/Metadata.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1059,7 +1059,7 @@ SWIFT_RUNTIME_EXPORT
10591059
void swift_initRawStructMetadata(StructMetadata *self,
10601060
StructLayoutFlags flags,
10611061
const TypeLayout *likeType,
1062-
ssize_t count);
1062+
int32_t count);
10631063

10641064
/// Initialize the value witness table for a struct using the provided like type
10651065
/// as the basis for the layout.

stdlib/public/runtime/Metadata.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3030,7 +3030,7 @@ SWIFT_RUNTIME_EXPORT
30303030
void swift::swift_initRawStructMetadata(StructMetadata *structType,
30313031
StructLayoutFlags layoutFlags,
30323032
const TypeLayout *likeTypeLayout,
3033-
ssize_t count) {
3033+
int32_t count) {
30343034
auto vwtable = getMutableVWTableForInit(structType, layoutFlags);
30353035

30363036
// The existing vwt function entries are all fine to preserve, the only thing
@@ -3040,9 +3040,9 @@ void swift::swift_initRawStructMetadata(StructMetadata *structType,
30403040
auto alignMask = likeTypeLayout->flags.getAlignmentMask();
30413041
auto extraInhabitantCount = likeTypeLayout->extraInhabitantCount;
30423042

3043-
// If our count is not -1, we're dealing an array like layout.
3044-
if (count != -1) {
3045-
stride *= (size_t)count;
3043+
// If our count is greater than or equal 0, we're dealing an array like layout.
3044+
if (count >= 0) {
3045+
stride *= count;
30463046
size = stride;
30473047
}
30483048

test/abi/macOS/arm64/stdlib.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -569,6 +569,7 @@ Added: __swift_willThrowTypedImpl
569569
Added: __swift_enableSwizzlingOfAllocationAndRefCountingFunctions_forInstrumentsOnly
570570
Added: _swift_clearSensitive
571571
Added: _swift_updatePureObjCClassMetadata
572+
Added: _swift_initRawStructMetadata2
572573

573574
// Runtime bincompat functions for Concurrency runtime to detect legacy mode
574575
Added: _swift_bincompat_useLegacyNonCrashingExecutorChecks

test/abi/macOS/x86_64/stdlib.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -569,6 +569,7 @@ Added: __swift_willThrowTypedImpl
569569
Added: __swift_enableSwizzlingOfAllocationAndRefCountingFunctions_forInstrumentsOnly
570570
Added: _swift_clearSensitive
571571
Added: _swift_updatePureObjCClassMetadata
572+
Added: _swift_initRawStructMetadata2
572573

573574
// Runtime bincompat functions for Concurrency runtime to detect legacy mode
574575
Added: _swift_bincompat_useLegacyNonCrashingExecutorChecks

0 commit comments

Comments
 (0)