Check for zero size in memrchr for x86_64
authorAndreas Schwab <schwab@redhat.com>
Thu, 13 Oct 2011 11:33:58 +0000 (13:33 +0200)
committerAndreas Schwab <schwab@redhat.com>
Thu, 13 Oct 2011 11:34:41 +0000 (13:34 +0200)
ChangeLog
sysdeps/x86_64/memrchr.S

index a917b6e..36cd1e2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2011-10-13  Andreas Schwab  <schwab@redhat.com>
 
+       * sysdeps/x86_64/memrchr.S: Check for zero size.
+
        * string/stratcliff.c: Add memrchr tests.
 
 2011-10-12  Liubov Dmitrieva  <liubov.dmitrieva@gmail.com>
index 81b7a1c..70adca3 100644 (file)
@@ -282,6 +282,9 @@ L(return_null):
 
        .p2align 4
 L(length_less16_offset0):
+       test    %edx, %edx
+       jz      L(return_null)
+
        mov     %dl, %cl
        pcmpeqb (%rdi), %xmm1