Changeset 1523 in svn


Ignore:
Timestamp:
2014-09-11T16:31:11Z (3 years ago)
Author:
Xuefer
Message:

refix fix leak in decompiler/disassembler, was broken for older PHP

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/xcache.c

    r1493 r1523  
    355355{
    356356    zval *value;
     357    zval value_copied;
    357358
    358359    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &value) == FAILURE) {
    359360        return;
    360361    }
     362    value_copied = *value;
     363    value = &value_copied;
    361364
    362365    switch ((Z_TYPE_P(value) & IS_CONSTANT_TYPE_MASK)) {
    363366    case IS_CONSTANT:
    364         MAKE_COPY_ZVAL(&value, return_value)
    365         return_value->type = UNISW(IS_STRING, UG(unicode) ? IS_UNICODE : IS_STRING);
     367        value->type = UNISW(IS_STRING, UG(unicode) ? IS_UNICODE : IS_STRING);
     368        RETURN_ZVAL(value, 1, 0);
    366369        break;
    367370
    368371#ifdef IS_CONSTANT_ARRAY
    369372    case IS_CONSTANT_ARRAY:
    370         MAKE_COPY_ZVAL(&value, return_value)
    371         return_value->type = IS_ARRAY;
     373        value->type = IS_ARRAY;
     374        RETURN_ZVAL(value, 1, 0);
    372375        break;
    373376#endif
     
    381384    default:
    382385        if ((Z_TYPE_P(value) & ~IS_CONSTANT_TYPE_MASK)) {
    383             MAKE_COPY_ZVAL(&value, return_value);
    384             return_value->type &= IS_CONSTANT_TYPE_MASK;
     386            value->type &= IS_CONSTANT_TYPE_MASK;
     387            RETURN_ZVAL(value, 1, 0);
    385388        }
    386389        else {
  • trunk/xcache/xc_compatibility.h

    r1493 r1523  
    220220/* }}} */
    221221
    222 #ifndef MAKE_COPY_ZVAL
    223 #   define MAKE_COPY_ZVAL(ppzv, pzv) \
    224     *(pzv) = **(ppzv);            \
    225     zval_copy_ctor((pzv));        \
    226     INIT_PZVAL((pzv));
    227 #endif
    228 
    229222/* the class entry type to be stored in class_table */
    230223typedef ZESW(zend_class_entry, zend_class_entry*) xc_cest_t;
Note: See TracChangeset for help on using the changeset viewer.