mirror of
https://github.com/reactos/syzkaller.git
synced 2024-11-24 03:49:45 +00:00
pkg/csource: fix casting of parameters for trampolines
Signed-off-by: Alexander Egorenkov <Alexander.Egorenkov@ibm.com>
This commit is contained in:
parent
aea82c003a
commit
b202c7a8a2
@ -3528,3 +3528,10 @@ static void setup_usb()
|
||||
fail("failed to chmod /dev/raw-gadget");
|
||||
}
|
||||
#endif
|
||||
|
||||
#if GOARCH_s390x
|
||||
#include <sys/mman.h>
|
||||
// Ugly way to work around gcc's "error: function called through a non-compatible type".
|
||||
// The macro is used in generated C code.
|
||||
#define CAST(f) ({void* p = (void*)f; p; })
|
||||
#endif
|
||||
|
@ -265,13 +265,14 @@ func (ctx *context) emitCall(w *bytes.Buffer, call prog.ExecCall, ci int, haveCo
|
||||
}
|
||||
|
||||
func (ctx *context) emitCallName(w *bytes.Buffer, call prog.ExecCall, native bool) {
|
||||
callName := call.Meta.CallName
|
||||
callName, ok := ctx.sysTarget.SyscallTrampolines[call.Meta.CallName]
|
||||
if !ok {
|
||||
callName = call.Meta.CallName
|
||||
}
|
||||
if native {
|
||||
fmt.Fprintf(w, "syscall(%v%v", ctx.sysTarget.SyscallPrefix, callName)
|
||||
} else if strings.HasPrefix(callName, "syz_") {
|
||||
fmt.Fprintf(w, "%v(", callName)
|
||||
} else if trampolineName, ok := ctx.sysTarget.SyscallTrampolines[callName]; ok {
|
||||
fmt.Fprintf(w, "%v(", trampolineName)
|
||||
} else {
|
||||
args := strings.Repeat(",intptr_t", len(call.Args))
|
||||
if args != "" {
|
||||
|
@ -8376,6 +8376,11 @@ static void setup_usb()
|
||||
}
|
||||
#endif
|
||||
|
||||
#if GOARCH_s390x
|
||||
#include <sys/mman.h>
|
||||
#define CAST(f) ({void* p = (void*)f; p; })
|
||||
#endif
|
||||
|
||||
#elif GOOS_test
|
||||
|
||||
#include <stdlib.h>
|
||||
|
Loading…
Reference in New Issue
Block a user