Browse Source

disassembler: fix nullable array handling

git-svn-id: svn://svn.lighttpd.net/xcache/trunk@1287 c26eb9a1-5813-0410-bd6c-c2e55f420ca7
3.1
Xuefer 8 years ago
parent
commit
907b84caed
  1. 2
      processor/processor.m4
  2. 6
      processor/struct.m4

2
processor/processor.m4

@ -194,7 +194,9 @@ DEF_STRUCT_P_FUNC(`zval_ptr', , `dnl {{{
dnl }}}
DEF_STRUCT_P_FUNC(`zval_ptr_nullable', , `dnl {{{
if (src[0]) {
pushdef(`DASM_STRUCT_DIRECT')
STRUCT_P_EX(zval_ptr, dst, src, `', `', ` ')
popdef(`DASM_STRUCT_DIRECT')
}
else {
IFCOPY(`COPYNULL_EX(src[0], src)')

6
processor/struct.m4

@ -132,24 +132,28 @@ define(`STRUCT_P_EX', `
ifdef(`DEFINED_'ifelse(`$5', `', `$1', `$5'), `', `m4_errprint(`AUTOCHECK ERROR: Unknown struct "'ifelse(`$5', `', `$1', `$5')`"')define(`EXIT_PENDING', 1)')
assert(sizeof($1) == sizeof(($6 $3)[0]));
ifelse(`$6', `', `ALLOC(`$2', `$1')')
ifdef(`DASM_STRUCT_DIRECT', `', `
IFDASM(`do {
zval *zv;
ALLOC_INIT_ZVAL(zv);
array_init(zv);
')
')
FUNC_NAME`'(
IFDPRINT( ` $6 $3, indent')
IFCALC( `processor, $6 $3')
IFSTORE( `processor, $6 $2, $6 $3')
IFRESTORE(`processor, $6 $2, $6 $3')
IFDASM( `dasm, zv, $6 $3')
IFDASM( `dasm, ifdef(`DASM_STRUCT_DIRECT', `dst', `zv'), $6 $3')
IFASM( `$6 $2, $6 $3')
TSRMLS_CC
);
ifdef(`DASM_STRUCT_DIRECT', `', `
IFDASM(`
add_assoc_zval_ex(dst, ZEND_STRS("$4"), zv);
} while (0);
')
')
popdef(`FUNC_NAME')
ifelse(`$6', , `FIXPOINTER_EX(`$1', `$2')')
')

Loading…
Cancel
Save