#551: t/pmc/nci.t: 2 test failures
---------------------+------------------------------------------------------
Reporter: jkeenan | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: none | Version:
Severity: medium | Keywords: pmc nci pointer
Lang: | Patch:
Platform: |
---------------------+------------------------------------------------------
Comment(by whiteknight):
The best way to fix this all that I can think of is to change the
semantics of the Pointer PMC. Right now, the PMC is more like a "value"
PMC, instead of a "pointer". Here's some code from src/nci.c:pcf_v_V():
{{{
t_872 = GET_NCI_P(0);
v_872 = VTABLE_get_pointer(interp, t_872);
(void)(*pointer)(&v_872);
VTABLE_set_pointer(interp, t_872, v_872);
}}}
If, instead of holding a single value v_872, the Pointer PMC could
allocate a small amount of storage space, and pass a return a pointer to
that space from get_pointer. Right now, VTABLE_get_pointer on the Pointer
PMC does this:
{{{
return(PARROT_POINTER(SELF)->pointer);
}}}
Instead, I suggest it do something like this:
{{{
return(&(PARROT_POINTER(SELF)->buffer));
}}}
So then we can change the NCI thunk to do this:
{{{
t_872 = GET_NCI_P(0);
v_872 = VTABLE_get_pointer(interp, t_872);
(void)(*pointer)(v_872);
}}}
Any opinions on this?
--
Ticket URL: <https://trac.parrot.org/parrot/ticket/551#comment:6>
Parrot <https://trac.parrot.org/parrot/>
Parrot Development
_______________________________________________
parrot-tickets mailing list
[email protected]
http://lists.parrot.org/mailman/listinfo/parrot-tickets