summaryrefslogtreecommitdiff
path: root/processor
diff options
context:
space:
mode:
authorXuefer <xuefer@gmail.com>2014-05-28 16:24:54 +0000
committerXuefer <xuefer@gmail.com>2014-05-28 16:24:54 +0000
commit9a7a9f8fd23a69c2b41f856618c603fbc4893951 (patch)
tree37bf8442fe70f1283bf90e1dc9e4318c7870cd84 /processor
parent24b06d437f3c0ee9f80fc75e1485cb4f896a5b5c (diff)
downloadxcache-9a7a9f8fd23a69c2b41f856618c603fbc4893951.tar.gz
xcache-9a7a9f8fd23a69c2b41f856618c603fbc4893951.zip
disassembler: fix support for assoc/next
git-svn-id: svn://svn.lighttpd.net/xcache/trunk@1492 c26eb9a1-5813-0410-bd6c-c2e55f420ca7
Diffstat (limited to 'processor')
-rw-r--r--processor/main.m419
-rw-r--r--processor/process.m48
2 files changed, 21 insertions, 6 deletions
diff --git a/processor/main.m4 b/processor/main.m4
index 7077c5c..d4fa0c1 100644
--- a/processor/main.m4
+++ b/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);
')
diff --git a/processor/process.m4 b/processor/process.m4
index b474a1c..d7d7c40 100644
--- a/processor/process.m4
+++ b/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')
')