]> granicus.if.org Git - strace/commitdiff
Do not call umoven to fetch parameters if we have zero params
authorDenys Vlasenko <dvlasenk@redhat.com>
Wed, 8 Jun 2011 23:32:23 +0000 (01:32 +0200)
committerDenys Vlasenko <dvlasenk@redhat.com>
Wed, 8 Jun 2011 23:32:23 +0000 (01:32 +0200)
* syscall.c [I386] (syscall_enter): Do not call umoven
to fetch zero bytes. This is just an optimization.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
syscall.c

index b7fabe0078559faeb27487ab883c9fc2d3e9dad8..c9a5b9f893bc97e0e652411a1b0c833ddcbae4e9 100644 (file)
--- a/syscall.c
+++ b/syscall.c
@@ -2352,8 +2352,9 @@ syscall_enter(struct tcb *tcp)
                tcp->u_nargs = sysent[tcp->scno].nargs;
        else
                tcp->u_nargs = 5;
-       umoven(tcp, tcp->status.PR_REG[UESP] + 4,
-               tcp->u_nargs*sizeof(tcp->u_arg[0]), (char *) tcp->u_arg);
+       if (tcp->u_nargs > 0)
+               umoven(tcp, tcp->status.PR_REG[UESP] + 4,
+                       tcp->u_nargs*sizeof(tcp->u_arg[0]), (char *) tcp->u_arg);
 #else
        I DONT KNOW WHAT TO DO
 #endif /* !HAVE_PR_SYSCALL */