2003-04-05  Roland McGrath  <roland@redhat.com>

	* sysdeps/unix/sysv/linux/i386/setcontext.S: Rewrite to avoid writing
	below the stack pointer even if switching to the same context we are
	running right now.

	* catgets/gencat.c (read_input_file): Make sure that \n is not
	alone on the line before testing for continuation.

	* math/test-tgmath.c (compile_test): Initialize c.
This commit is contained in:
Ulrich Drepper 2003-04-05 22:03:35 +00:00
parent ee6bf14d9e
commit a5392bed09
3 changed files with 29 additions and 33 deletions

View File

@ -1,6 +1,15 @@
2003-04-05 Roland McGrath <roland@redhat.com>
* sysdeps/unix/sysv/linux/i386/setcontext.S: Rewrite to avoid writing
below the stack pointer even if switching to the same context we are
running right now.
2003-04-05 Ulrich Drepper <drepper@redhat.com> 2003-04-05 Ulrich Drepper <drepper@redhat.com>
* math/test-tgmath.c (F): Initialize c. * catgets/gencat.c (read_input_file): Make sure that \n is not
alone on the line before testing for continuation.
* math/test-tgmath.c (compile_test): Initialize c.
2003-04-05 Alexandre Oliva <aoliva@redhat.com> 2003-04-05 Alexandre Oliva <aoliva@redhat.com>

View File

@ -333,7 +333,7 @@ read_input_file (struct catalog *current, const char *fname)
/* There might be more than one backslash at the end of /* There might be more than one backslash at the end of
the line. Only if there is an odd number of them is the line. Only if there is an odd number of them is
the line continued. */ the line continued. */
if (buf[act_len - 1] == '\\') if (act_len > 0 && buf[act_len - 1] == '\\')
{ {
int temp_act_len = act_len; int temp_act_len = act_len;

View File

@ -1,5 +1,5 @@
/* Install given context. /* Install given context.
Copyright (C) 2001, 2002 Free Software Foundation, Inc. Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of the GNU C Library. This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2001. Contributed by Ulrich Drepper <drepper@redhat.com>, 2001.
@ -53,39 +53,26 @@ ENTRY(__setcontext)
movl oFS(%eax), %ecx movl oFS(%eax), %ecx
movw %cx, %fs movw %cx, %fs
/* Fetch the address to return to. */
movl oEIP(%eax), %ecx
/* Load the new stack pointer. */ /* Load the new stack pointer. */
movl oESP(%eax), %ecx movl oESP(%eax), %esp
/* Make room for 8 registers and the return address. We will load
the values from the stack. */
subl $36, %ecx
/* Move the values of all the 32-bit registers (except ESP) on /* Push the return address on the new stack so we can return there. */
the stack. This happens in the form the 'popa' instruction pushl %ecx
expects it. Before this block put the address of the code
to execute. */
movl oEDI(%eax), %ebx
movl oESI(%eax), %edx
movl oEBP(%eax), %esi
movl oEBX(%eax), %edi
movl %ebx, (%ecx)
movl %edx, 4(%ecx)
movl %esi, 8(%ecx)
movl %edi, 16(%ecx)
movl oEDX(%eax), %ebx
movl oECX(%eax), %edx
movl oEAX(%eax), %esi
movl oEIP(%eax), %edi
movl %ebx, 20(%ecx)
movl %edx, 24(%ecx)
movl %esi, 28(%ecx)
movl %edi, 32(%ecx)
/* Set the new stack address. The stack points now to the block /* Load the values of all the 32-bit registers (except ESP).
we put the register content in. */ Since we are loading from EAX, it must be last. */
movl %ecx, %esp movl oEDI(%eax), %edi
/* Restore the register content. */ movl oESI(%eax), %esi
popa movl oEBP(%eax), %ebp
/* The following 'ret' will pop the addres of the code and jump movl oEBX(%eax), %ebx
movl oEDX(%eax), %edx
movl oECX(%eax), %ecx
movl oEAX(%eax), %eax
/* The following 'ret' will pop the address of the code and jump
to it. */ to it. */
L(pseudo_end): L(pseudo_end):