-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[SR-14813] [Fuzzers] Fix the mangler and reflection fuzzer build. #38023
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
Conversation
The mangler fuzzer and reflection fuzzer build was broken, both by a problem in the CMake scripts and also because of changes that have happened in other parts of the code.
@swift-ci Please smoke test |
case DLQ_GetPtrAuthMask: { | ||
auto result = static_cast<uintptr_t *>(outBuffer); | ||
#if __has_feature(ptrauth_calls) | ||
*result = (uintptr_t)ptrauth_strip((void*)0x0007ffffffffffff, 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have a true mask that we can rely on instead of hard coding?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a comment here explaining what you are doing in more detail. That is can you explain here what you are actually testing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also you should run this through git-clang-format. The reason why I know that you haven't is that (void*)
should be (void *)
. Also can you use static_cast like the rest of the code rather than using c casts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also I think that __has_feature is a clang extension.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All of the above is true, however I copied this piece of code directly from include/swift/Remote/InProcessMemoryReader.h
(apparently the original was written by @kubamracek).
Not sure where that leaves us exactly. Should I fix that file at the same time?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as __has_feature()
goes, it looks like we use it all over the shop, and various files have their own variant of
#ifndef __has_feature
#define __has_feature(x) 0
#endif
which arguably belongs in swift/Basic/Compiler.h
with the other similar defines. Maybe fixing that should be a separate PR, though?
We only had the C/C++/ObjC/ObjC++ option. Add the Swift one too.
Replace use of stdio.h, stddef.h and stdint.h with the C++ versions of those headers.
We should be using C++ casts here.
Used git-clang-format to fix up the changed code.
@swift-ci Please smoke test |
The mangler fuzzer and reflection fuzzer build was broken, both by a problem in the CMake scripts and also because of changes that have happened in other parts of the code.
Resolves SR-14813.
rdar://79623532