develooper Front page | perl.perl6.internals | Postings from July 2002

[perl #814] [PATCH] fix PMC type morphing

Thread Next
Sean O'Rourke
July 14, 2002 13:00
[perl #814] [PATCH] fix PMC type morphing
Message ID:
# New Ticket Created by  "Sean O'Rourke" 
# Please include the string:  [perl #814]
# in the subject line of all future correspondence about this issue. 
# <URL: >

PerlString sets the PMC_is_buffer_ptr_FLAG flag in pmc->flags, but none of
the other Perl types do.  The GC uses this flag to tell whether or not to
look for a buffer pointer in the PMC.  Certain operations currently change
a PMC from one type to another simply by updating its vtable pointer.
Since they don't update the flag, this causes problems in collection.  The
problem I saw was a buffer not being marked, but the opposite could
happen as well -- interpreting a former-String PMC as a buffer pointer
could cause a seg fault or memory leak.

So we need to set the flag if we're turning something into a PerlString,
and clear it if we're turning something that is a string into something
else.  This patch adds a macro to do these things, in a file


-- attachment  1 ------------------------------------------------------

-- attachment  2 ------------------------------------------------------

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About