# New Ticket Created by  Simon Glover 
# Please include the string:  [perl #18445]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt2/Ticket/Display.html?id=18445 >



 Packfile_new assumes that the memory it gets from mem_sys_allocate is
 zeroed, which is no longer the case. This causes Bad Things to happen
 when I run parrot with --gc-debug (and, frankly, I think it's only
 luck that's stopping Bad Things from happening the rest of the time
 as well). The patch below fixes the problem by initializing to 0 (or
 NULL) everything that's currently unitialized; an alternative fix
 would be to change mem_sys_allocate to mem_sys_allocate_zeroed --
 I can send a patch that fixes it that way if people would prefer.

 Simon

--- packfile.c.old      Sat Nov 16 16:11:43 2002
+++ packfile.c  Sat Nov 16 17:16:33 2002
@@ -86,6 +86,11 @@ PackFile_new(void)
     /* Other fields empty for now */
     pf->byte_code = NULL;
     pf->byte_code_size = 0;
+    pf->need_wordsize = 0;
+    pf->need_endianize = 0;
+    pf->fetch_op = NULL;
+    pf->fetch_iv = NULL;
+    pf->fetch_nv = NULL;

     return pf;
 }





Reply via email to