Browse Source

MFT: merge [1493],[1496] from trunk, fix leak in decompiler/disassembler

git-svn-id: svn://svn.lighttpd.net/xcache/branches/3.2@1516 c26eb9a1-5813-0410-bd6c-c2e55f420ca7
3.2
Xuefer 7 years ago
parent
commit
1dfe7ccb1d
  1. 9
      xcache.c
  2. 7
      xcache/xc_compatibility.h

9
xcache.c

@ -338,15 +338,13 @@ PHP_FUNCTION(xcache_get_special_value)
switch ((Z_TYPE_P(value) & IS_CONSTANT_TYPE_MASK)) {
case IS_CONSTANT:
*return_value = *value;
zval_copy_ctor(return_value);
MAKE_COPY_ZVAL(&value, return_value)
return_value->type = UNISW(IS_STRING, UG(unicode) ? IS_UNICODE : IS_STRING);
break;
#ifdef IS_CONSTANT_ARRAY
case IS_CONSTANT_ARRAY:
*return_value = *value;
zval_copy_ctor(return_value);
MAKE_COPY_ZVAL(&value, return_value)
return_value->type = IS_ARRAY;
break;
#endif
@ -359,8 +357,7 @@ PHP_FUNCTION(xcache_get_special_value)
default:
if ((Z_TYPE_P(value) & ~IS_CONSTANT_TYPE_MASK)) {
*return_value = *value;
zval_copy_ctor(return_value);
MAKE_COPY_ZVAL(&value, return_value);
return_value->type &= IS_CONSTANT_TYPE_MASK;
}
else {

7
xcache/xc_compatibility.h

@ -219,6 +219,13 @@ typedef const zstr const_zstr;
#endif
/* }}} */
#ifndef MAKE_COPY_ZVAL
# define MAKE_COPY_ZVAL(ppzv, pzv) \
*(pzv) = **(ppzv); \
zval_copy_ctor((pzv)); \
INIT_PZVAL((pzv));
#endif
/* the class entry type to be stored in class_table */
typedef ZESW(zend_class_entry, zend_class_entry*) xc_cest_t;

Loading…
Cancel
Save