> This was failing here until I made the following change:
> 
> PackFile_Constant_unpack_number(struct PackFile_Constant * 
> self, char * packed, IV packed_size) {
>     char * cursor;
>     NV     value;
>     NV *   aligned = mem_sys_allocate(sizeof(IV));

Are you sure this is correct? Or this is before the fix.

Allocating NV using sizeof(IV) is strange. I don't see the
need to have aligned temp variable. The following code
will do exact as your code (I believe). The memcpy() can
handle alignment nicely.

PackFile_Constant_unpack_number(struct PackFile_Constant * self, char *
packed, IV packed_size) {
    PackFile_Constant_clear(self);

    self->type   = PFC_NUMBER;
    memcpy(&(self->number), packed, sizeof(NV));

    return 1;
}

Hong

Reply via email to