Skip to content

Commit

Permalink
Merge pull request swiftlang#59169 from al45tair/eng/PR-94143566
Browse files Browse the repository at this point in the history
[Tools] Fix swift-reflection-fuzzer.
  • Loading branch information
al45tair authored May 31, 2022
2 parents 11752f8 + efe5997 commit 46a746b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tools/swift-reflection-fuzzer/swift-reflection-fuzzer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include <cstddef>
#include <cstdint>
#include <cstdio>
#include <iostream>

#if defined(__APPLE__) && defined(__MACH__)
#include <TargetConditionals.h>
Expand All @@ -43,7 +44,7 @@ using namespace swift::reflection;
using namespace swift::remote;

using NativeReflectionContext = swift::reflection::ReflectionContext<
External<RuntimeTarget<sizeof(uintptr_t)>>>;
External<WithObjCInterop<RuntimeTarget<sizeof(uintptr_t)>>>>;

template <typename T> static T unwrap(llvm::Expected<T> value) {
if (value)
Expand Down Expand Up @@ -142,6 +143,6 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
auto reader = std::make_shared<ObjectMemoryReader>();
NativeReflectionContext context(std::move(reader));
context.addImage(RemoteAddress(Data));
context.getBuilder().dumpAllSections(stdout);
context.getBuilder().dumpAllSections<WithObjCInterop, sizeof(uintptr_t)>(std::cout);
return 0; // Non-zero return values are reserved for future use.
}

0 comments on commit 46a746b

Please sign in to comment.