소스 검색

fix clobber of edx in i386 vsyscall asm

this function does not obey the normal calling convention; like a
syscall instruction, it's expected not to clobber any registers except
the return value. clobbering edx could break callers that were reusing
the value cached in edx after the syscall returns.
Rich Felker 12 년 전
부모
커밋
e9b885ee55
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      src/internal/i386/syscall.s

+ 2 - 1
src/internal/i386/syscall.s

@@ -16,7 +16,8 @@ __vsyscall:
 	mov 12(%esp),%edi
 	push %eax
 	call 1f
-2:	pop %ebx
+2:	mov %ebx,%edx
+	pop %ebx
 	pop %ebx
 	pop %edi
 	ret