Use memmove to copy overlap memory.
authorH.J. Lu <hjl.tools@gmail.com>
Tue, 30 Mar 2010 23:20:25 +0000 (23:20 +0000)
committerH.J. Lu <hjl.tools@gmail.com>
Tue, 30 Mar 2010 23:20:25 +0000 (23:20 +0000)
2010-03-30  H.J. Lu  <hongjiu.lu@intel.com>

PR gas/11456
* input-scrub.c (input_scrub_next_buffer): Use memmove instead
of memcpy to copy overlap memory.

gas/ChangeLog
gas/input-scrub.c

index 390447b3318f6c3c48faeda453ab8da6104dc5ad..37d682f32f3f3df9554e7fe3f536f90bc026b4ff 100644 (file)
@@ -1,3 +1,9 @@
+2010-03-30  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR gas/11456
+       * input-scrub.c (input_scrub_next_buffer): Use memmove instead
+       of memcpy to copy overlap memory.
+
 2010-03-25  Joseph Myers  <joseph@codesourcery.com>
 
        * Makefile.am (TARGET_CPU_CFILES): Add config/tc-tic6x.c.
index a2cd31b3f6e4114dd54a8f533109fc5a9fe10d44..e1ff5cc0a505d48840692c326811709ce19938b4 100644 (file)
@@ -343,8 +343,8 @@ input_scrub_next_buffer (char **bufp)
 
   if (partial_size)
     {
-      memcpy (buffer_start + BEFORE_SIZE, partial_where,
-             (unsigned int) partial_size);
+      memmove (buffer_start + BEFORE_SIZE, partial_where,
+              (unsigned int) partial_size);
       memcpy (buffer_start + BEFORE_SIZE, save_source, AFTER_SIZE);
     }
   limit = input_file_give_next_buffer (buffer_start