Changeset 828 in svn for trunk/processor/string.m4


Ignore:
Timestamp:
2012-03-23T09:04:14+01:00 (3 years ago)
Author:
Xuefer
Message:

fix constant name handling (possible SIGSEGV)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/processor/string.m4

    r690 r828  
    2121            STRTYPE, `zstr_char',  `ZSTR_S($1)',
    2222            `',      `',           `$1'))
    23     pushdef(`U', ifelse(
    24             PTRTYPE, `char',  `',
    25             PTRTYPE, `UChar', `u'))
     23    pushdef(`STRDUP', ifelse(
     24            PTRTYPE, `char',  `estrndup',
     25            PTRTYPE, `UChar', `eustrndup'))
    2626    if (SRCPTR == NULL) {
    2727        IFNOTMEMCPY(`IFCOPY(`
     
    6262        IFSTORE(`DSTPTR = ifelse(PTRTYPE,`char',`ZSTR_S',`ZSTR_U')(xc_store_string_n(processor, ISTYPE, SRCSTR, $3 C_RELAYLINE));')
    6363        IFRESTORE(`
    64             DSTPTR = e`'U`'strndup(SRCPTR, ($3) - 1);
     64            DSTPTR = STRDUP() (SRCPTR, ($3) - 1);
    6565        ')
    6666        FIXPOINTER_EX(`PTRTYPE', DSTPTR)
     
    7777        ')
    7878    }
    79     popdef(`U')
     79    popdef(`STRDUP')
    8080    popdef(`DSTPTR')
    8181    popdef(`SRCPTR')
Note: See TracChangeset for help on using the changeset viewer.