Skip to content

Commit adfab01

Browse files
authored
Embedded: fix arguments mismatch in ResultTypeInfo (#80862)
Mismatched number of arguments traps on Wasm. Second argument of `destroy` in VW seems unused, so let's pass `nullptr` as a workaround.
1 parent bc07600 commit adfab01

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

include/swift/ABI/Task.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ struct ResultTypeInfo {
240240
void (*initializeWithCopy)(OpaqueValue *result, OpaqueValue *src) = nullptr;
241241
void (*storeEnumTagSinglePayload)(OpaqueValue *v, unsigned whichCase,
242242
unsigned emptyCases) = nullptr;
243-
void (*destroy)(OpaqueValue *) = nullptr;
243+
void (*destroy)(OpaqueValue *, void *) = nullptr;
244244

245245
bool isNull() {
246246
return initializeWithCopy == nullptr;
@@ -259,7 +259,7 @@ struct ResultTypeInfo {
259259
storeEnumTagSinglePayload(v, whichCase, emptyCases);
260260
}
261261
void vw_destroy(OpaqueValue *v) {
262-
destroy(v);
262+
destroy(v, nullptr);
263263
}
264264
#endif
265265
};

include/swift/ABI/TaskOptions.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ class AsyncLetWithBufferTaskOptionRecord : public TaskOptionRecord {
199199
AsyncLet *getAsyncLet() const {
200200
return asyncLet;
201201
}
202-
202+
203203
void *getResultBuffer() const {
204204
return resultBuffer;
205205
}
@@ -224,7 +224,7 @@ class ResultTypeInfoTaskOptionRecord : public TaskOptionRecord {
224224
storeEnumTagSinglePayload)(OpaqueValue *, unsigned, unsigned);
225225

226226
void (*__ptrauth_swift_value_witness_function_pointer(
227-
SpecialPointerAuthDiscriminators::Destroy) destroy)(OpaqueValue *);
227+
SpecialPointerAuthDiscriminators::Destroy) destroy)(OpaqueValue *, void *);
228228

229229
static bool classof(const TaskOptionRecord *record) {
230230
return record->getKind() == TaskOptionRecordKind::ResultTypeInfo;

0 commit comments

Comments
 (0)