Ticket #430: pf_items.p1

File pf_items.p1, 0.9 KB (added by doughera, 13 years ago)
Line 
1--- parrot-svn/src/packfile/pf_items.c  Tue Mar 10 08:05:04 2009
2+++ parrot-andy/src/packfile/pf_items.c Tue Mar 10 11:55:04 2009
3@@ -1370,16 +1370,13 @@
4         size_t i;
5         mem_sys_memcopy(charcursor, s->strstart, s->bufused);
6         charcursor += s->bufused;
7-
8-        if (s->bufused % sizeof (opcode_t)) {
9-            for (i = 0; i < (sizeof (opcode_t) -
10-                        (s->bufused % sizeof (opcode_t))); i++) {
11-                *charcursor++ = 0;
12-            }
13+        /* Pad up to sizeof(opcode_t) boundary. */
14+        while ( (unsigned long) (charcursor - (char *) cursor) % sizeof(opcode_t)) {
15+            *charcursor++ = 0;
16         }
17     }
18-    PARROT_ASSERT(((long)charcursor & 3) == 0);
19-    cursor = (opcode_t *)charcursor;
20+    PARROT_ASSERT(((unsigned long) (charcursor - (char *) cursor) % sizeof(opcode_t)) == 0);
21+    cursor += (charcursor - (char *) cursor) / sizeof(opcode_t);
22 
23     return cursor;
24 }