Sourceware Bugzilla – Attachment 5341 Details for
Bug 12518
memcpy acts randomly (and differently) with overlapping areas
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch to check for overlaps
glibc-memcpy-ssse3.patch (text/plain), 1.20 KB, created by
Felipe Contreras
on 2011-03-30 07:21:26 UTC
(
hide
)
Description:
Patch to check for overlaps
Filename:
MIME Type:
Creator:
Felipe Contreras
Created:
2011-03-30 07:21:26 UTC
Size:
1.20 KB
patch
obsolete
>--- glibc-2.13/sysdeps/x86_64/multiarch/memcpy-ssse3.S 2011-01-18 06:34:07.000000000 +0200 >+++ glibc-2.13/sysdeps/x86_64/multiarch/memcpy-ssse3.S 2011-03-29 20:06:11.449090136 +0300 >@@ -84,6 +84,17 @@ L(copy_forward): > ALIGN (4) > L(80bytesormore): > #ifndef USE_AS_MEMMOVE >+ lea (%rsi,%rdx),%r9 >+ lea (%rdi,%rdx),%r11 >+ cmp %rdi,%r9 /* dest start >= source end */ >+ jae L(nonoverlap) /* -> nonoverlapping */ >+ cmp %rsi,%r11 /* source start >= destination end */ >+ jae L(nonoverlap) /* -> nonoverlapping */ >+ movb $0, 0 >+ L(nonoverlap): >+#endif >+ >+#ifndef USE_AS_MEMMOVE > cmp %dil, %sil > jle L(copy_backward) > #endif >--- glibc-2.13/sysdeps/x86_64/multiarch/memcpy-ssse3-back.S 2011-01-18 06:34:07.000000000 +0200 >+++ glibc-2.13/sysdeps/x86_64/multiarch/memcpy-ssse3-back.S 2011-03-29 20:06:21.252112024 +0300 >@@ -90,6 +90,16 @@ L(bk_write): > > ALIGN (4) > L(144bytesormore): >+#ifndef USE_AS_MEMMOVE >+ lea (%rsi,%rdx),%r9 >+ lea (%rdi,%rdx),%r11 >+ cmp %rdi,%r9 /* dest start >= source end */ >+ jae L(nonoverlap) /* -> nonoverlapping */ >+ cmp %rsi,%r11 /* source start >= destination end */ >+ jae L(nonoverlap) /* -> nonoverlapping */ >+ movb $0, 0 >+ L(nonoverlap): >+#endif > > #ifndef USE_AS_MEMMOVE > cmp %dil, %sil
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 12518
:
5264
|
5323
|
5341
|
5660