Changeset 828 in svn for trunk/processor


Ignore:
Timestamp:
2012-03-23T08:04:14Z (7 years ago)
Author:
Xuefer
Message:

fix constant name handling (possible SIGSEGV)

Location:
trunk/processor
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/processor/processor.m4

    r825 r828  
    253253    DISPATCH(int, flags)
    254254    DISPATCH(uint, name_len)
    255     pushdef(`emalloc', `malloc($1)')
    256     pushdef(`ecalloc', `calloc($1, $2)')
     255    pushdef(`estrndup', `zend_strndup')
    257256    PROC_ZSTRING_N(, name, name_len)
    258     popdef(`ecalloc')
    259     popdef(`emalloc')
     257    popdef(`estrndup')
    260258    DISPATCH(int, module_number)
    261259')
  • 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.