Browse Source

disassembler: fix support for assoc/next

git-svn-id: svn://svn.lighttpd.net/xcache/trunk@1492 c26eb9a1-5813-0410-bd6c-c2e55f420ca7
master
Xuefer 8 years ago
parent
commit
9a7a9f8fd2
  1. 19
      processor/main.m4
  2. 8
      processor/process.m4

19
processor/main.m4

@ -164,12 +164,27 @@ dnl {{{ COPYPOINTER
define(`COPYPOINTER', `COPY(`$1')')
dnl }}}
dnl {{{ SETNULL_EX
define(`SETNULL_EX', `IFCOPY(`$1 = NULL;')')
define(`SETNULL_EX', `
IFDASM(`
ifelse(`$2', `[]', `
add_next_index_null(DST());
', `
add_assoc_null_ex(DST(), XCACHE_STRS("ifelse(`$2', `', `$1', `$2')"));
')
')
IFCOPY(`$1 = NULL;')
')
define(`SETNULL', `SETNULL_EX(`DST(`$1')')DONE(`$1')')
dnl }}}
dnl {{{ COPYNULL_EX(1:dst, 2:elm-name)
define(`COPYNULL_EX', `
IFDASM(`add_assoc_null_ex(DST(), XCACHE_STRS("$2"));')
IFDASM(`
ifelse(`$2', `[]', `
add_next_index_null(DST());
', `
add_assoc_null_ex(DST(), XCACHE_STRS("ifelse(`$2', `', `$1', `$2')"));
')
')
IFNOTMEMCPY(`IFCOPY(`$1 = NULL;')')
assert(patsubst($1, DST(), SRC()) == NULL);
')

8
processor/process.m4

@ -93,10 +93,10 @@ define(`PROCESS_ARRAY', `dnl {{{ (1:count, 2:type, 3:elm, [4:real_type])
++LOOPCOUNTER) {
pushdef(`dst', `arr')
pushdef(`SRC', `ifelse(`$4', `', `', `($2)')' defn(`SRC') `[LOOPCOUNTER]')
popdef(`add_assoc_bool_ex', `add_next_index_bool($1, $3)')
popdef(`add_assoc_string_ex', `add_next_index_string($1, $3)')
popdef(`add_assoc_long_ex', `add_next_index_long($1, $3)')
popdef(`add_assoc_zval_ex', `add_next_index_zval($1, $3)')
pushdef(`add_assoc_bool_ex', `add_next_index_bool($1, $3)')
pushdef(`add_assoc_string_ex', `add_next_index_string($1, $3)')
pushdef(`add_assoc_long_ex', `add_next_index_long($1, $3)')
pushdef(`add_assoc_zval_ex', `add_next_index_zval($1, $3)')
DISABLECHECK(`
PROCESS(`$2', `$3')
')

Loading…
Cancel
Save