Skip to content
Merged
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
7 changes: 5 additions & 2 deletions runtime/macos_host/illegal_probe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

bool fix_illegal(ucontext_t* uc);
static int traps;
static int fails;
static void on_ill(int, siginfo_t*, void* uc) {
++traps;
if (!fix_illegal(static_cast<ucontext_t*>(uc))) { std::puts("unhandled SIGILL"); _exit(1); }
Expand Down Expand Up @@ -39,11 +40,13 @@ static unsigned __int128 run(std::vector<uint8_t> body, uint64_t a, uint64_t b,
mprotect(g_code, 1 << 16, PROT_READ | PROT_EXEC);
auto f = reinterpret_cast<Fn>(p);
unsigned __int128 r1 = f(), r2 = f();
if (r1 != r2) std::puts(" first and second run differ");
if (r1 != r2) {
std::puts(" first and second run differ");
++fails;
}
return r1;
}

static int fails;
static void check(const char* what, uint64_t got, uint64_t want) {
std::printf("%-40s %s got %016llx want %016llx\n", what, got == want ? "ok " : "FAIL", (unsigned long long)got,
(unsigned long long)want);
Expand Down