On Thursday 05 July 2007 19:58:50 Patrick R. Michaud wrote:

> I also get segfaults after applying this patch.
>
> However, if I change the patch such that the "size_t sentinel;"
> line goes at the end of the struct PMC instead of the beginning,
> then everything appears to compile and run.
>
> In fact, if "size_t sentinel;" is placed as the second or third
> line in the struct (i.e., after "pobj_t obj;" or "VTABLE *vtable;")
> then things still appear to compile and run.  It's only when the
> sentinel is given as the first line that I get errors.
>
> So, I'm guessing there's some code somewhere that assumes that
> "obj" is always the first component of PMC.

Right, and the clue was also in parrot/pobj.h.  Because buffers, strings, and 
PMCs all are PObjs, their structs must be isomorphic.  Hoisting the sentinel 
into the pobj_t struct gets past that segfault.

Structural subtyping hates me.

-- c

Reply via email to