Skip to content

Embedded: fix arguments mismatch in ResultTypeInfo #80862

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions include/swift/ABI/Task.h
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ struct ResultTypeInfo {
void (*initializeWithCopy)(OpaqueValue *result, OpaqueValue *src) = nullptr;
void (*storeEnumTagSinglePayload)(OpaqueValue *v, unsigned whichCase,
unsigned emptyCases) = nullptr;
void (*destroy)(OpaqueValue *) = nullptr;
void (*destroy)(OpaqueValue *, void *) = nullptr;

bool isNull() {
return initializeWithCopy == nullptr;
Expand All @@ -259,7 +259,7 @@ struct ResultTypeInfo {
storeEnumTagSinglePayload(v, whichCase, emptyCases);
}
void vw_destroy(OpaqueValue *v) {
destroy(v);
destroy(v, nullptr);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestions for how to test this with lit would be appreciated. I reckon we need some mock SerialExecutor implementation and Task invocation in such test? I've reproduced it with JavaScriptKit's JavaScriptEventLoop: SerialExecutor in the first place with this code.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally I would love to see runtime tests covering this. Can we / do we have runtime tests running wasm?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MaxDesiatov I think this issue could be reproduced with default cooperative executor.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have an existing non-embedded test suite for WASI. The best course of action would be enable that for embedded where possible, WDYT?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, sounds good to me

}
#endif
};
Expand Down
4 changes: 2 additions & 2 deletions include/swift/ABI/TaskOptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ class AsyncLetWithBufferTaskOptionRecord : public TaskOptionRecord {
AsyncLet *getAsyncLet() const {
return asyncLet;
}

void *getResultBuffer() const {
return resultBuffer;
}
Expand All @@ -224,7 +224,7 @@ class ResultTypeInfoTaskOptionRecord : public TaskOptionRecord {
storeEnumTagSinglePayload)(OpaqueValue *, unsigned, unsigned);

void (*__ptrauth_swift_value_witness_function_pointer(
SpecialPointerAuthDiscriminators::Destroy) destroy)(OpaqueValue *);
SpecialPointerAuthDiscriminators::Destroy) destroy)(OpaqueValue *, void *);

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