mirror of
git://sourceware.org/git/glibc.git
synced 2025-03-13 13:37:38 +08:00
(__makecontext): Handle more than 6 args correctly. Based on a patch by Masahide Washizawa.
This commit is contained in:
parent
29762ba617
commit
c2df18a970
@ -58,11 +58,11 @@ __makecontext (ucontext_t *ucp, void (*func) (void), int argc, ...)
|
||||
|
||||
/* Generate room on stack for parameter if needed and uc_link. */
|
||||
sp = (long *) ((long) ucp->uc_stack.ss_sp + ucp->uc_stack.ss_size);
|
||||
sp -= (argc > 6 ? argc : 0) + 1;
|
||||
sp -= (argc > 6 ? argc - 6 : 0) + 1;
|
||||
/* Align stack and make space for trampoline address. */
|
||||
sp = (long *) ((((long) sp) & -16L) - 8);
|
||||
|
||||
idx_uc_link = (argc > 6 ? argc : 0) + 1;
|
||||
idx_uc_link = (argc > 6 ? argc - 6 : 0) + 1;
|
||||
|
||||
/* Setup context ucp. */
|
||||
/* Address to jump to. */
|
||||
@ -100,7 +100,7 @@ __makecontext (ucontext_t *ucp, void (*func) (void), int argc, ...)
|
||||
break;
|
||||
default:
|
||||
/* Put value on stack. */
|
||||
sp[8 + (i - 5)] = va_arg (ap, int);
|
||||
sp[(i - 5)] = va_arg (ap, int);
|
||||
break;
|
||||
}
|
||||
va_end (ap);
|
||||
|
Loading…
x
Reference in New Issue
Block a user