Ticket #254: tt254-floattype1-bug.patch

File tt254-floattype1-bug.patch, 1.1 KB (added by rurban, 13 years ago)

replaces first version from nopaste

  • src/packfile/pf_items.c

     
    618618#if TRACE_PACKFILE 
    619619    Parrot_io_eprintf(NULL, "PF_fetch_number: Byteordering..\n"); 
    620620#endif 
    621     /* Here is where the size transforms get messy */ 
    622     if (NUMVAL_SIZE == 8 && ! pf->header->floattype) { 
     621    /* Here is where the size transforms get messy. 
     622       Floattype 0 = IEEE-754 8 byte double 
     623       Floattype 1 = x86 little endian 12 byte long double 
     624    */ 
     625    if (NUMVAL_SIZE == 8 && pf->header->floattype) { 
     626        (pf->fetch_nv)((unsigned char *)&d, (const unsigned char *) *stream); 
     627        f = d; 
     628    } 
     629    else { 
    623630        (pf->fetch_nv)((unsigned char *)&f, (const unsigned char *) *stream); 
     631    } 
     632    if (pf->header->floattype) { 
    624633        *((const unsigned char **) (stream)) += 12; 
    625634    } 
    626635    else { 
    627         (pf->fetch_nv)((unsigned char *)&d, (const unsigned char *) *stream); 
    628636        *((const unsigned char **) (stream)) += 8; 
    629         f = d; 
    630637    } 
    631638    return f; 
    632639}