[svn:parrot] r37959 - branches/packfile_revamp/src

bacek at svn.parrot.org bacek at svn.parrot.org
Tue Apr 7 21:34:49 UTC 2009


Author: bacek
Date: Tue Apr  7 21:34:48 2009
New Revision: 37959
URL: https://trac.parrot.org/parrot/changeset/37959

Log:
Fill one more padding with zeros

Modified:
   branches/packfile_revamp/src/packfile.c

Modified: branches/packfile_revamp/src/packfile.c
==============================================================================
--- branches/packfile_revamp/src/packfile.c	Tue Apr  7 21:34:07 2009	(r37958)
+++ branches/packfile_revamp/src/packfile.c	Tue Apr  7 21:34:48 2009	(r37959)
@@ -2304,6 +2304,7 @@
     /*const size_t               align    = 16/sizeof (opcode_t);*/
     size_t i;
     PackFile           * const pf       = self->pf;
+    opcode_t                 * old_cursor;          // Used for filling padding with 0
 
     *cursor++ = num_segs;
 
@@ -2317,7 +2318,11 @@
 
     TRACE_PRINTF_ALIGN(("-ALIGN_16: offset=0x%x src=0x%x cursor=0x%x\n",
                       OFFS(pf, cursor), pf->src, cursor));
+    old_cursor = cursor;
     ALIGN_16(pf, cursor);
+    /* fill padding with zeros */
+    while (old_cursor != cursor)
+        *old_cursor++ = 0;
     TRACE_PRINTF_ALIGN(("+ALIGN_16: offset=0x%x src=0x%x cursor=0x%x\n",
                       OFFS(pf, cursor), pf->src, cursor));
     /*if (align && (cursor - self->pf->src) % align)


More information about the parrot-commits mailing list