Fix x86 __memset_chk.

When __memset_chk_fail moved to C++, we didn't take into account
that the stack wasn't set up correctly for the jump from assembler.
Presumably no one had run the 32-bit x86 tests until now!

Bug: http://b/30513094
Change-Id: Iab9fbc731b6bfecd7ca4d3f3844d0568a5d30d86
This commit is contained in:
Lev Rumyantsev 2016-07-29 17:55:42 -07:00 committed by Elliott Hughes
parent 3318c56c99
commit 3a528f1cbf
2 changed files with 8 additions and 4 deletions

View File

@ -117,8 +117,10 @@ ENTRY(__memset_chk)
movl LEN(%esp), %ecx movl LEN(%esp), %ecx
cmpl CHK_DST_LEN(%esp), %ecx cmpl CHK_DST_LEN(%esp), %ecx
ja __memset_chk_fail jna L(memset_length_loaded)
jmp L(memset_length_loaded)
POP (%ebx) // Undo ENTRANCE without returning.
jmp __memset_chk_fail
END(__memset_chk) END(__memset_chk)
.section .text.sse2,"ax",@progbits .section .text.sse2,"ax",@progbits

View File

@ -117,8 +117,10 @@ ENTRY(__memset_chk)
movl LEN(%esp), %ecx movl LEN(%esp), %ecx
cmpl CHK_DST_LEN(%esp), %ecx cmpl CHK_DST_LEN(%esp), %ecx
ja __memset_chk_fail jna L(memset_length_loaded)
jmp L(memset_length_loaded)
POP (%ebx) // Undo ENTRANCE without returning.
jmp __memset_chk_fail
END(__memset_chk) END(__memset_chk)
.section .text.sse2,"ax",@progbits .section .text.sse2,"ax",@progbits