Ticket #863: cpointer.patch

File cpointer.patch, 0.7 KB (added by bacek, 5 years ago)

CPointer.clone proposed fix

  • src/pmc/cpointer.pmc

    diff --git a/src/pmc/cpointer.pmc b/src/pmc/cpointer.pmc
    index 27c2204..0bee988 100644
    a b  
    133133*/ 
    134134 
    135135    VTABLE PMC *clone() { 
    136         PMC * const dest = pmc_new_noinit(INTERP, SELF->vtable->base_type); 
    137         PObj_custom_mark_SET(dest); 
    138         PMC_data(dest) = PMC_data(SELF); 
     136        PMC * const dest = pmc_new(INTERP, SELF->vtable->base_type); 
     137        Parrot_CPointer_attributes * const self_attrs = PARROT_CPOINTER(SELF); 
     138        Parrot_CPointer_attributes * const dest_attrs = PARROT_CPOINTER(dest); 
     139        dest_attrs->sig     = self_attrs->sig; 
     140        dest_attrs->pointer = self_attrs->pointer; 
    139141        return dest; 
    140142    } 
    141143