aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/csource
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2017-09-27 11:44:15 +0200
committerDmitry Vyukov <dvyukov@google.com>2017-09-27 18:59:50 +0200
commitbdffe2484cfffefd2f3321cb42890be70887cf44 (patch)
treed0479d4e02301160ddb11c09f154d115cc70d80f /pkg/csource
parent11fc874fb5c0446e3eebe3a3ca4bad19c6407505 (diff)
executor: fix execution of windows syscalls
First, they must be called with stdcall convention. Second, wrap them in __try/__except because they can crash.
Diffstat (limited to 'pkg/csource')
-rw-r--r--pkg/csource/common.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/pkg/csource/common.go b/pkg/csource/common.go
index c38f805da..7f34a8753 100644
--- a/pkg/csource/common.go
+++ b/pkg/csource/common.go
@@ -146,7 +146,11 @@ __attribute__((noreturn)) static void doexit(int status)
#endif
#if defined(SYZ_EXECUTOR)
-typedef long (*syscall_t)(long, long, long, long, long, long, long, long, long);
+#ifndef SYSCALLAPI
+#define SYSCALLAPI
+#endif
+
+typedef long(SYSCALLAPI* syscall_t)(long, long, long, long, long, long, long, long, long);
struct call_t {
const char* name;
@@ -274,6 +278,7 @@ static uint16_t csum_inet_digest(struct csum_inet* csum)
return ~csum->acc;
}
#endif
+
#if defined(SYZ_EXECUTOR) || defined(SYZ_HANDLE_SEGV)
static __thread int skip_segv;
static __thread jmp_buf segv_env;