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

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


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

Log:
Fill padding with zeros during pack

Modified:
   branches/packfile_revamp/src/packfile.c

Modified: branches/packfile_revamp/src/packfile.c
==============================================================================
--- branches/packfile_revamp/src/packfile.c	Tue Apr  7 21:33:33 2009	(r37957)
+++ branches/packfile_revamp/src/packfile.c	Tue Apr  7 21:34:07 2009	(r37958)
@@ -1831,6 +1831,7 @@
     /*const size_t align             = 16 / sizeof (opcode_t);*/
     PackFile_Segment_pack_func_t f =
         self->pf->PackFuncs[self->type].pack;
+    opcode_t * old_cursor;          // Used for filling padding with 0
 #if TRACE_PACKFILE
     PackFile * const pf  = self->pf;
 #endif
@@ -1842,7 +1843,12 @@
 
     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(self->pf, cursor);
+    /* fill padding with zeros */
+    while (old_cursor != cursor)
+        *old_cursor++ = 0;
+
     /*if (align && (cursor - self->pf->src) % align)
       cursor += align - (cursor - self->pf->src) % align;*/
     TRACE_PRINTF_ALIGN(("+ALIGN_16: offset=0x%x src=0x%x cursor=0x%x\n",


More information about the parrot-commits mailing list