From 39c3fb1b157927058f24b72d43be6f15c1d422b7 Mon Sep 17 00:00:00 2001 From: rsc Date: Thu, 27 Sep 2007 19:39:10 +0000 Subject: overkill: use segments to catch stack overflow (delete before next year) --- swtch.S | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'swtch.S') diff --git a/swtch.S b/swtch.S index 786e9ac..8aa4c2e 100644 --- a/swtch.S +++ b/swtch.S @@ -16,10 +16,14 @@ swtch: movl %esi, 20(%eax) movl %edi, 24(%eax) movl %ebp, 28(%eax) + movl %ss, %ebx + movl %ebx, 32(%eax) # Load new registers movl 4(%esp), %eax # not 8(%esp) - popped return address above + movl 32(%eax), %ebx + movl %ebx, %ss movl 28(%eax), %ebp movl 24(%eax), %edi movl 20(%eax), %esi -- cgit v1.2.3