source: trunk/processor/processor.m4 @ 1232

Last change on this file since 1232 was 1232, checked in by moo, 18 months ago

PHP_5_5: fix build

  • Property svn:eol-style set to native
File size: 30.6 KB
Line 
1dnl ================
2/* {{{ Pre-declare */
3DECL_STRUCT_P_FUNC(`zval')
4DECL_STRUCT_P_FUNC(`zval_ptr')
5DECL_STRUCT_P_FUNC(`zval_ptr_nullable')
6DECL_STRUCT_P_FUNC(`zend_op_array')
7DECL_STRUCT_P_FUNC(`zend_class_entry')
8#ifdef HAVE_XCACHE_CONSTANT
9DECL_STRUCT_P_FUNC(`zend_constant')
10#endif
11DECL_STRUCT_P_FUNC(`zend_function')
12DECL_STRUCT_P_FUNC(`xc_entry_var_t')
13DECL_STRUCT_P_FUNC(`xc_entry_php_t')
14#ifdef ZEND_ENGINE_2
15DECL_STRUCT_P_FUNC(`zend_property_info')
16#endif
17/* }}} */
18dnl ====================================================
19#ifdef IS_CV
20DEF_STRUCT_P_FUNC(`zend_compiled_variable', , `dnl {{{
21    PROCESS(int, name_len)
22    PROC_ZSTRING_L(, name, name_len)
23    PROCESS(ulong, hash_value)
24')
25dnl }}}
26#endif
27DEF_STRUCT_P_FUNC(`zend_uint', , `dnl {{{
28    IFCOPY(`dst[0] = src[0];')
29    IFDPRINT(`
30        INDENT()
31        fprintf(stderr, "%u\n", src[0]);
32    ')
33    DONE_SIZE(sizeof(src[0]))
34')
35dnl }}}
36#ifndef ZEND_ENGINE_2
37DEF_STRUCT_P_FUNC(`int', , `dnl {{{
38    IFCOPY(`*dst = *src;')
39    IFDPRINT(`
40        INDENT()
41        fprintf(stderr, "%d\n", src[0]);
42    ')
43    DONE_SIZE(sizeof(src[0]))
44')
45dnl }}}
46#endif
47#ifdef ZEND_ENGINE_2
48DEF_STRUCT_P_FUNC(`zend_try_catch_element', , `dnl {{{
49    PROCESS(zend_uint, try_op)
50    PROCESS(zend_uint, catch_op)
51#ifdef ZEND_ENGINE_2_5
52    PROCESS(zend_uint, finally_op)
53    PROCESS(zend_uint, finally_end)
54#endif
55')
56dnl }}}
57#endif
58DEF_STRUCT_P_FUNC(`zend_brk_cont_element', , `dnl {{{
59#ifdef ZEND_ENGINE_2_2
60    PROCESS(int, start)
61#endif
62    PROCESS(int, cont)
63    PROCESS(int, brk)
64    PROCESS(int, parent)
65')
66dnl }}}
67DEF_HASH_TABLE_FUNC(`HashTable_zval_ptr',           `zval_ptr')
68DEF_HASH_TABLE_FUNC(`HashTable_zend_function',      `zend_function')
69#ifdef ZEND_ENGINE_2
70DEF_HASH_TABLE_FUNC(`HashTable_zend_property_info', `zend_property_info')
71#endif
72DEF_STRUCT_P_FUNC(`zval', , `dnl {{{
73    IFDASM(`do {
74        zval_dtor(dst);
75        *dst = *src;
76        zval_copy_ctor(dst);
77        Z_SET_REFCOUNT(*dst, 1);
78        DONE(value)
79        DONE(type)
80#ifdef ZEND_ENGINE_2_3
81        DONE(is_ref__gc)
82        DONE(refcount__gc)
83#else
84        DONE(is_ref)
85        DONE(refcount)
86#endif
87    } while(0);
88    ', `
89        dnl IFDASM else
90        /* Variable information */
91dnl {{{ zvalue_value
92        DISABLECHECK(`
93        switch ((Z_TYPE_P(src) & IS_CONSTANT_TYPE_MASK)) {
94            case IS_LONG:
95            case IS_RESOURCE:
96            case IS_BOOL:
97                PROCESS(long, value.lval)
98                break;
99            case IS_DOUBLE:
100                PROCESS(double, value.dval)
101                break;
102            case IS_NULL:
103                IFDPRINT(`INDENT()`'fprintf(stderr, "\tNULL\n");')
104                break;
105
106            case IS_CONSTANT:
107#ifdef IS_UNICODE
108                if (UG(unicode)) {
109                    goto proc_unicode;
110                }
111#endif
112            case IS_STRING:
113#ifdef FLAG_IS_BC
114            case FLAG_IS_BC:
115#endif
116                PROCESS(int, value.str.len)
117                PROC_STRING_L(value.str.val, value.str.len)
118                break;
119#ifdef IS_UNICODE
120            case IS_UNICODE:
121proc_unicode:
122                PROCESS(int32_t, value.uni.len)
123                PROC_ZSTRING_L(1, value.uni.val, value.uni.len)
124                break;
125#endif
126
127            case IS_ARRAY:
128            case IS_CONSTANT_ARRAY:
129                STRUCT_P(HashTable, value.ht, HashTable_zval_ptr)
130                break;
131
132            case IS_OBJECT:
133                IFNOTMEMCPY(`IFCOPY(`memcpy(dst, src, sizeof(src[0]));')')
134                dnl STRUCT(value.obj)
135#ifndef ZEND_ENGINE_2
136                STRUCT_P(zend_class_entry, value.obj.ce)
137                STRUCT_P(HashTable, value.obj.properties, HashTable_zval_ptr)
138#endif
139                break;
140
141            default:
142                assert(0);
143        }
144        ')
145dnl }}}
146        DONE(value)
147        PROCESS(xc_zval_type_t, type)
148#ifdef ZEND_ENGINE_2_3
149        PROCESS(zend_uchar, is_ref__gc)
150#else
151        PROCESS(zend_uchar, is_ref)
152#endif
153
154#ifdef ZEND_ENGINE_2_3
155        PROCESS(zend_uint, refcount__gc)
156#elif defined(ZEND_ENGINE_2)
157        PROCESS(zend_uint, refcount)
158#else
159        PROCESS(zend_ushort, refcount)
160#endif
161    ')dnl IFDASM
162')
163dnl }}}
164DEF_STRUCT_P_FUNC(`zval_ptr', , `dnl {{{
165    IFDASM(`
166        pushdefFUNC_NAME(`zval')
167        FUNC_NAME (dasm, dst, src[0] TSRMLS_CC);
168        popdef(`FUNC_NAME')
169    ', `
170        do {
171            IFCALCCOPY(`
172                if (processor->reference) {
173                    zval_ptr *ppzv;
174                    if (zend_hash_find(&processor->zvalptrs, (char *) &src[0], sizeof(src[0]), (void **) &ppzv) == SUCCESS) {
175                        IFCOPY(`
176                            dst[0] = *ppzv;
177                            /* *dst is updated */
178                            dnl fprintf(stderr, "*dst is set to %p, PROCESSOR_TYPE is_shm %d\n", dst[0], xc_is_shm(dst[0]));
179                        ')
180                        IFCALCSTORE(`processor->have_references = 1;')
181                        IFSTORE(`assert(xc_is_shm(dst[0]));')
182                        IFRESTORE(`assert(!xc_is_shm(dst[0]));')
183                        break;
184                    }
185                }
186            ')
187           
188            ALLOC(dst[0], zval)
189            IFCALCCOPY(`
190                if (processor->reference) {
191                    IFCALC(`
192                        /* make dummy */
193                        zval_ptr pzv = (zval_ptr)-1;
194                    ', `
195                        zval_ptr pzv = dst[0];
196                        FIXPOINTER_EX(zval, pzv)
197                    ')
198                    if (zend_hash_add(&processor->zvalptrs, (char *) &src[0], sizeof(src[0]), (void *) &pzv, sizeof(pzv), NULL) == SUCCESS) {
199                        /* first add, go on */
200                        dnl fprintf(stderr, "mark[%p] = %p\n", src[0], pzv);
201                    }
202                    else {
203                        assert(0);
204                    }
205                }
206            ')
207            IFCOPY(`
208                dnl fprintf(stderr, "copy from %p to %p\n", src[0], dst[0]);
209            ')
210            IFDPRINT(`INDENT()`'fprintf(stderr, "[%p] ", src[0]);')
211            STRUCT_P_EX(zval, dst[0], src[0], `[0]', `', ` ')
212            FIXPOINTER_EX(zval, dst[0])
213        } while (0);
214    ')
215    DONE_SIZE(sizeof(zval_ptr))
216')
217dnl }}}
218DEF_STRUCT_P_FUNC(`zval_ptr_nullable', , `dnl {{{
219    if (src[0]) {
220        STRUCT_P_EX(zval_ptr, dst, src, `', `', ` ')
221    }
222    else {
223        IFCOPY(`COPYNULL_EX(src[0], src)')
224    }
225    DONE_SIZE(sizeof(zval_ptr_nullable))
226')
227dnl }}}
228#ifdef ZEND_ENGINE_2
229DEF_STRUCT_P_FUNC(`zend_arg_info', , `dnl {{{
230    PROCESS(zend_uint, name_len)
231    PROC_ZSTRING_L(, name, name_len)
232    PROCESS(zend_uint, class_name_len)
233    PROC_ZSTRING_L(, class_name, class_name_len)
234#ifdef ZEND_ENGINE_2_4
235    PROCESS(zend_uchar, type_hint)
236#else
237    PROCESS(zend_bool, array_type_hint)
238#endif
239    PROCESS(zend_bool, allow_null)
240    PROCESS(zend_bool, pass_by_reference)
241#ifndef ZEND_ENGINE_2_4
242    PROCESS(zend_bool, return_reference)
243    PROCESS(int, required_num_args)
244#endif
245')
246dnl }}}
247#endif
248#ifdef HAVE_XCACHE_CONSTANT
249DEF_STRUCT_P_FUNC(`zend_constant', , `dnl {{{
250    STRUCT(zval, value)
251    PROCESS(int, flags)
252    PROCESS(uint, name_len)
253    pushdef(`estrndup', `zend_strndup')
254    PROC_ZSTRING_N(, name, name_len)
255    popdef(`estrndup')
256    PROCESS(int, module_number)
257')
258dnl }}}
259#endif
260DEF_STRUCT_P_FUNC(`zend_function', , `dnl {{{
261    DISABLECHECK(`
262    switch (src->type) {
263    case ZEND_INTERNAL_FUNCTION:
264    case ZEND_OVERLOADED_FUNCTION:
265        IFNOTMEMCPY(`IFCOPY(`memcpy(dst, src, sizeof(src[0]));')')
266        break;
267
268    case ZEND_USER_FUNCTION:
269    case ZEND_EVAL_CODE:
270        DONE(type)
271        STRUCT(zend_op_array, op_array)
272        break;
273
274    default:
275        assert(0);
276    }
277    ')
278    DONE_SIZE(sizeof(src[0]))
279')
280dnl }}}
281#ifdef ZEND_ENGINE_2
282DEF_STRUCT_P_FUNC(`zend_property_info', , `dnl {{{
283    PROCESS(zend_uint, flags)
284    PROCESS(int, name_length)
285    PROC_ZSTRING_L(, name, name_length)
286    PROCESS(ulong, h)
287#ifdef ZEND_ENGINE_2_4
288    PROCESS(int, offset)
289#endif
290#ifdef ZEND_ENGINE_2_1
291    PROCESS(int, doc_comment_len)
292    PROC_ZSTRING_L(, doc_comment, doc_comment_len)
293#endif
294    dnl isnt in php6 yet
295#if defined(ZEND_ENGINE_2_2)
296    PROC_CLASS_ENTRY_P(ce)
297#endif
298')
299dnl }}}
300#endif
301#ifdef ZEND_ENGINE_2_4
302DEF_STRUCT_P_FUNC(`zend_trait_method_reference', , `dnl {{{
303    PROCESS(unsigned int, mname_len)
304    PROC_STRING_L(method_name, mname_len)
305    COPYNULL(ce)
306    PROCESS(unsigned int, cname_len)
307    PROC_STRING_L(class_name, cname_len)
308')
309dnl }}}
310DEF_STRUCT_P_FUNC(`zend_trait_alias', , `dnl {{{
311    STRUCT_P(zend_trait_method_reference, trait_method)
312    PROCESS(unsigned int, alias_len)
313    PROC_STRING_L(alias, alias_len)
314    PROCESS(zend_uint, modifiers)
315#ifndef ZEND_ENGINE_2_5
316    COPYNULL(function)
317#endif
318')
319dnl }}}
320DEF_STRUCT_P_FUNC(`zend_trait_precedence', , `dnl {{{
321    STRUCT_P(zend_trait_method_reference, trait_method)
322    PROCESS_ARRAY(, xc_ztstring, exclude_from_classes, zend_class_entry*)
323#ifndef ZEND_ENGINE_2_5
324    COPYNULL(function)
325#endif
326')
327dnl }}}
328DEF_STRUCT_P_FUNC(`zend_trait_alias_ptr', , `dnl {{{
329    IFDASM(`
330        pushdefFUNC_NAME(`zend_trait_alias')
331        FUNC_NAME (dasm, dst, src[0] TSRMLS_CC);
332        popdef(`FUNC_NAME')
333    ', `
334        ALLOC(dst[0], zend_trait_alias)
335        STRUCT_P_EX(zend_trait_alias, dst[0], src[0], `[0]', `', ` ')
336        FIXPOINTER_EX(zend_trait_alias, dst[0])
337    ')
338    DONE_SIZE(sizeof(zend_trait_alias))
339')
340dnl }}}
341DEF_STRUCT_P_FUNC(`zend_trait_precedence_ptr', , `dnl {{{
342    IFDASM(`
343        pushdefFUNC_NAME(`zend_trait_precedence')
344        FUNC_NAME (dasm, dst, src[0] TSRMLS_CC);
345        popdef(`FUNC_NAME')
346    ', `
347        ALLOC(dst[0], zend_trait_precedence)
348        STRUCT_P_EX(zend_trait_precedence, dst[0], src[0], `[0]', `', ` ')
349        FIXPOINTER_EX(zend_trait_precedence, dst[0])
350    ')
351    DONE_SIZE(sizeof(zend_trait_precedence))
352')
353dnl }}}
354#endif
355DEF_STRUCT_P_FUNC(`zend_class_entry', , `dnl {{{
356    IFCALCCOPY(`
357        processor->active_class_entry_src = src;
358        IFCOPY(`processor->active_class_entry_dst = dst;')
359    ')
360    PROCESS(char, type)
361    PROCESS(zend_uint, name_length)
362    PROC_ZSTRING_L(, name, name_length)
363    IFRESTORE(`
364#ifndef ZEND_ENGINE_2
365        /* just copy parent and resolve on install_class */
366        COPY(parent)
367#else
368        PROC_CLASS_ENTRY_P(parent)
369#endif
370    ', `
371        PROC_CLASS_ENTRY_P(parent)
372    ')
373#ifdef ZEND_ENGINE_2
374    PROCESS(int, refcount)
375#else
376    STRUCT_P(int, refcount)
377#endif
378#ifndef ZEND_ENGINE_2_4
379    PROCESS(zend_bool, constants_updated)
380#endif
381#ifdef ZEND_ENGINE_2
382    PROCESS(zend_uint, ce_flags)
383#endif
384
385#ifdef ZEND_ENGINE_2
386    STRUCT(HashTable, properties_info, HashTable_zend_property_info)
387#endif
388
389#ifdef ZEND_ENGINE_2_4
390    STRUCT_ARRAY(int, default_properties_count, zval_ptr_nullable, default_properties_table)
391    PROCESS(int, default_properties_count)
392    STRUCT_ARRAY(int, default_static_members_count, zval_ptr_nullable, default_static_members_table)
393    PROCESS(int, default_static_members_count)
394    IFCOPY(`dst->static_members_table = dst->default_static_members_table;')
395    DONE(static_members_table)
396#else
397    IFCOPY(`dst->builtin_functions = src->builtin_functions;')
398    DONE(builtin_functions)
399    STRUCT(HashTable, default_properties, HashTable_zval_ptr)
400#   ifdef ZEND_ENGINE_2_1
401    STRUCT(HashTable, default_static_members, HashTable_zval_ptr)
402    IFCOPY(`dst->static_members = &dst->default_static_members;')
403    DONE(static_members)
404#   elif defined(ZEND_ENGINE_2)
405    STRUCT_P(HashTable, static_members, HashTable_zval_ptr)
406#   endif
407#endif /* ZEND_ENGINE_2_4 */
408
409#ifdef ZEND_ENGINE_2
410    STRUCT(HashTable, constants_table, HashTable_zval_ptr)
411
412#ifdef ZEND_ENGINE_2_2
413    dnl runtime binding: ADD_INTERFACE will deal with it
414    COPYNULL(`interfaces')
415    COPYZERO(`num_interfaces')
416
417#   ifdef ZEND_ENGINE_2_4
418    dnl runtime binding: ADD_TRAIT will deal with it
419    COPYNULL(traits)
420    COPYZERO(num_traits)
421    STRUCT_ARRAY(, , zend_trait_alias_ptr, trait_aliases)
422    STRUCT_ARRAY(, , zend_trait_precedence_ptr, trait_precedences)
423#   endif
424#else
425    IFRESTORE(`
426        if (src->num_interfaces) {
427            CALLOC(dst->interfaces, zend_class_entry*, src->num_interfaces)
428            DONE(`interfaces')
429        }
430        else {
431            COPYNULL(`interfaces')
432        }
433    ', `
434        DONE(`interfaces')
435    ')
436    PROCESS(zend_uint, num_interfaces)
437#endif
438
439#   ifdef ZEND_ENGINE_2_4
440    DISABLECHECK(`
441    IFRESTORE(`dst->info.user.filename = processor->entry_php_src->filepath;', `PROC_STRING(info.user.filename)')
442    PROCESS(zend_uint, info.user.line_start)
443    PROCESS(zend_uint, info.user.line_end)
444    PROCESS(zend_uint, info.user.doc_comment_len)
445    PROC_ZSTRING_L(, info.user.doc_comment, info.user.doc_comment_len)
446    ')
447    DONE(info)
448#   else
449    IFRESTORE(`dst->filename = processor->entry_php_src->filepath;DONE(filename)', `PROC_STRING(filename)')
450    PROCESS(zend_uint, line_start)
451    PROCESS(zend_uint, line_end)
452#       ifdef ZEND_ENGINE_2_1
453    PROCESS(zend_uint, doc_comment_len)
454    PROC_ZSTRING_L(, doc_comment, doc_comment_len)
455#       endif
456#   endif
457
458    /* # NOT DONE */
459    COPY(serialize_func)
460    COPY(unserialize_func)
461    COPY(iterator_funcs)
462    COPY(create_object)
463    COPY(get_iterator)
464    COPY(interface_gets_implemented)
465#   ifdef ZEND_ENGINE_2_3
466    COPY(get_static_method)
467#   endif
468    COPY(serialize)
469    COPY(unserialize)
470    /* deal with it inside xc_fix_method */
471    SETNULL(constructor)
472    COPY(destructor)
473    COPY(clone)
474    COPY(__get)
475    COPY(__set)
476/* should be >5.1 */
477#   ifdef ZEND_ENGINE_2_1
478    COPY(__unset)
479    COPY(__isset)
480#    if defined(ZEND_ENGINE_2_2) || PHP_MAJOR_VERSION >= 6
481    COPY(__tostring)
482#    endif
483#   endif
484    COPY(__call)
485#   ifdef ZEND_CALLSTATIC_FUNC_NAME
486    COPY(__callstatic)
487#   endif
488#   ifndef ZEND_ENGINE_2_4
489    /* # NOT DONE */
490    COPY(module)
491#   endif
492#else /* ZEND_ENGINE_2 */
493    COPY(handle_function_call)
494    COPY(handle_property_get)
495    COPY(handle_property_set)
496#endif
497    dnl must do after SETNULL(constructor) and dst->parent
498    STRUCT(HashTable, function_table, HashTable_zend_function)
499    IFRESTORE(`dst->function_table.pDestructor = ZEND_FUNCTION_DTOR;')
500    IFCALCCOPY(`
501        processor->active_class_entry_src = NULL;
502        IFCOPY(`processor->active_class_entry_dst = NULL;')
503    ')
504')
505dnl }}}
506#ifdef ZEND_ENGINE_2_4
507undefine(`UNION_znode_op')
508define(`UNION_znode_op', `dnl {{{
509#ifndef NDEBUG
510    switch ((src->$1_type ifelse($1, `result', & ~EXT_TYPE_UNUSED))) {
511    case IS_CONST:
512    case IS_VAR:
513    case IS_CV:
514    case IS_TMP_VAR:
515    case IS_UNUSED:
516        break;
517
518    default:
519        assert(0);
520    }
521#endif
522
523    dnl dirty dispatch
524    DISABLECHECK(`
525    switch ((src->$1_type ifelse($1, `result', & ~EXT_TYPE_UNUSED))) {
526        case IS_CONST:
527            ifelse($1, `result', `
528                PROCESS(zend_uint, $1.constant)
529            ', `
530                IFDASM(`{
531                    zval *zv;
532                    ALLOC_INIT_ZVAL(zv);
533                    *zv = dasm->active_op_array_src->literals[src->$1.constant].constant;
534                    zval_copy_ctor(zv);
535                    add_assoc_zval_ex(dst, ZEND_STRS("$1.constant"), zv);
536                }
537                ', `
538                    IFCOPY(`
539                        dst->$1 = src->$1;
540                    ', `
541                        PROCESS(zend_uint, $1.constant)
542                    ')
543                ')
544            ')
545            break;
546        IFCOPY(`
547            IFNOTMEMCPY(`
548                default:
549                    $1 = $2;
550            ')
551        ', `
552        case IS_VAR:
553        case IS_TMP_VAR:
554        case IS_CV:
555            PROCESS(zend_uint, $1.var)
556            break;
557        case IS_UNUSED:
558            IFDASM(`PROCESS(zend_uint, $1.var)')
559            PROCESS(zend_uint, $1.opline_num)
560            break;
561        ')
562    }
563    ')
564    DONE($1)
565')
566dnl }}}
567#else
568DEF_STRUCT_P_FUNC(`znode', , `dnl {{{
569    PROCESS(xc_op_type, op_type)
570
571#ifdef IS_CV
572#   define XCACHE_IS_CV IS_CV
573#else
574/* compatible with zend optimizer */
575#   define XCACHE_IS_CV 16
576#endif
577    assert(src->op_type == IS_CONST ||
578        src->op_type == IS_VAR ||
579        src->op_type == XCACHE_IS_CV ||
580        src->op_type == IS_TMP_VAR ||
581        src->op_type == IS_UNUSED);
582    dnl dirty dispatch
583    DISABLECHECK(`
584    switch (src->op_type) {
585        case IS_CONST:
586            STRUCT(zval, u.constant)
587            break;
588        IFCOPY(`
589            IFNOTMEMCPY(`
590                default:
591                    memcpy(&dst->u, &src->u, sizeof(src->u));
592            ')
593        ', `
594        case IS_VAR:
595        case IS_TMP_VAR:
596        case XCACHE_IS_CV:
597            PROCESS(zend_uint, u.var)
598            PROCESS(zend_uint, u.EA.type)
599            break;
600        case IS_UNUSED:
601            IFDASM(`PROCESS(zend_uint, u.var)')
602            PROCESS(zend_uint, u.opline_num)
603#ifndef ZEND_ENGINE_2
604            PROCESS(zend_uint, u.fetch_type)
605#endif
606            PROCESS(zend_uint, u.EA.type)
607            break;
608        ')
609    }
610    ')
611    DONE(u)
612#if 0
613    DONE(EA)
614#endif
615#undef XCACHE_IS_CV
616')
617dnl }}}
618#endif
619DEF_STRUCT_P_FUNC(`zend_op', , `dnl {{{
620    PROCESS(xc_opcode, opcode)
621#ifdef ZEND_ENGINE_2_4
622    IFRESTORE(`', `
623    switch (src->opcode) {
624    case ZEND_BIND_TRAITS:
625        ((zend_op *) src)->op2_type = IS_UNUSED;
626        break;
627    }
628    ')
629    UNION_znode_op(result)
630    UNION_znode_op(op1)
631    UNION_znode_op(op2)
632#else
633    STRUCT(znode, result)
634    STRUCT(znode, op1)
635    STRUCT(znode, op2)
636#endif
637    PROCESS(ulong, extended_value)
638    PROCESS(uint, lineno)
639#ifdef ZEND_ENGINE_2_1
640#ifdef ZEND_ENGINE_2_4
641    PROCESS(zend_uchar, op1_type)
642    PROCESS(zend_uchar, op2_type)
643    PROCESS(zend_uchar, result_type)
644#endif
645    IFCOPY(`
646        assert(processor->active_op_array_src);
647        assert(processor->active_op_array_dst);
648#ifdef ZEND_ENGINE_2_4
649        pushdef(`UNION_znode_op_literal', `
650            if (src->$1_type == IS_CONST) {
651                dst->$1.constant = src->$1.literal - processor->active_op_array_src->literals;
652                dst->$1.literal = &processor->active_op_array_dst->literals[dst->$1.constant];
653            }
654        ')
655        UNION_znode_op_literal(op1)
656        UNION_znode_op_literal(op2)
657#endif
658        popdef(`UNION_znode_op_literal')
659        switch (src->opcode) {
660#ifdef ZEND_GOTO
661            case ZEND_GOTO:
662#endif
663            case ZEND_JMP:
664#ifdef ZEND_FAST_CALL
665            case ZEND_FAST_CALL:
666#endif
667#ifdef ZEND_ENGINE_2
668                assert(Z_OP(src->op1).jmp_addr >= processor->active_op_array_src->opcodes && Z_OP(src->op1).jmp_addr - processor->active_op_array_src->opcodes < processor->active_op_array_src->last);
669                Z_OP(dst->op1).jmp_addr = processor->active_op_array_dst->opcodes + (Z_OP(src->op1).jmp_addr - processor->active_op_array_src->opcodes);
670                assert(Z_OP(dst->op1).jmp_addr >= processor->active_op_array_dst->opcodes && Z_OP(dst->op1).jmp_addr - processor->active_op_array_dst->opcodes < processor->active_op_array_dst->last);
671#endif
672                break;
673
674            case ZEND_JMPZ:
675            case ZEND_JMPNZ:
676            case ZEND_JMPZ_EX:
677            case ZEND_JMPNZ_EX:
678#ifdef ZEND_JMP_SET
679            case ZEND_JMP_SET:
680#endif
681#ifdef ZEND_JMP_SET_VAR
682            case ZEND_JMP_SET_VAR:
683#endif
684#ifdef ZEND_ENGINE_2
685                assert(Z_OP(src->op2).jmp_addr >= processor->active_op_array_src->opcodes && Z_OP(src->op2).jmp_addr - processor->active_op_array_src->opcodes < processor->active_op_array_src->last);
686                Z_OP(dst->op2).jmp_addr = processor->active_op_array_dst->opcodes + (Z_OP(src->op2).jmp_addr - processor->active_op_array_src->opcodes);
687                assert(Z_OP(dst->op2).jmp_addr >= processor->active_op_array_dst->opcodes && Z_OP(dst->op2).jmp_addr - processor->active_op_array_dst->opcodes < processor->active_op_array_dst->last);
688#endif
689                break;
690
691            default:
692                break;
693        }
694    ')
695    PROCESS(opcode_handler_t, handler)
696#endif
697')
698dnl }}}
699#ifdef ZEND_ENGINE_2_4
700DEF_STRUCT_P_FUNC(`zend_literal', , `dnl {{{
701    STRUCT(zval, constant)
702    PROCESS(zend_ulong, hash_value)
703    PROCESS(zend_uint,  cache_slot)
704')
705dnl }}}
706#endif
707DEF_STRUCT_P_FUNC(`zend_op_array', , `dnl {{{
708    IFCOPY(`
709        processor->active_op_array_dst = dst;
710        processor->active_op_array_src = src;
711    ')
712    IFDASM(`
713        dasm->active_op_array_src = src;
714    ')
715    {
716    IFRESTORE(`
717    const xc_op_array_info_t *op_array_info = &processor->active_op_array_infos_src[processor->active_op_array_index++];
718    dnl shadow copy must NOT meet:
719    dnl readonly_protection=on
720    dnl main op_array && have early binding
721#ifdef ZEND_COMPILE_DELAYED_BINDING
722    zend_bool need_early_binding = 0;
723#else
724    zend_bool need_early_binding = processor->php_src->have_early_binding;
725#endif
726    zend_bool shallow_copy = !processor->readonly_protection && !(src == processor->php_src->op_array && need_early_binding);
727    if (shallow_copy) {
728        zend_bool gc_arg_info = 0;
729        zend_bool gc_opcodes  = 0;
730        /* really fast shallow copy */
731        memcpy(dst, src, sizeof(src[0]));
732        dst->refcount[0] = 1000;
733#ifdef ZEND_ACC_ALIAS
734        if ((processor->active_class_entry_src && (processor->active_class_entry_src->ce_flags & ZEND_ACC_TRAIT))) {
735            PROC_ZSTRING(, function_name)
736        }
737#endif
738        /* deep */
739        STRUCT_P(HashTable, static_variables, HashTable_zval_ptr)
740#ifdef ZEND_ENGINE_2
741        STRUCT_ARRAY(zend_uint, num_args, zend_arg_info, arg_info)
742        gc_arg_info = 1;
743#endif
744        dst->filename = processor->entry_php_src->filepath;
745#ifdef ZEND_ENGINE_2_4
746        if (src->literals /* || op_array_info->literalsinfo_cnt */) {
747            gc_opcodes = 1;
748        }
749#else
750        if (op_array_info->oplineinfo_cnt) {
751            gc_opcodes = 1;
752        }
753#endif
754        if (gc_opcodes) {
755            zend_op *opline, *end;
756            COPY_N_EX(last, zend_op, opcodes)
757
758            for (opline = dst->opcodes, end = opline + src->last; opline < end; ++opline) {
759#ifdef ZEND_ENGINE_2_4
760                pushdef(`UNION_znode_op_literal', `
761                    if (opline->$1_type == IS_CONST) {
762                        opline->$1.literal = &dst->literals[opline->$1.literal - src->literals];
763                    }
764                ')
765                UNION_znode_op_literal(op1)
766                UNION_znode_op_literal(op2)
767                popdef(`UNION_znode_op_literal')
768#endif
769
770                switch (opline->opcode) {
771#ifdef ZEND_GOTO
772                    case ZEND_GOTO:
773#endif
774                    case ZEND_JMP:
775#ifdef ZEND_FAST_CALL
776                    case ZEND_FAST_CALL:
777#endif
778#ifdef ZEND_ENGINE_2
779                        Z_OP(opline->op1).jmp_addr = &dst->opcodes[Z_OP(opline->op1).jmp_addr - src->opcodes];
780#endif
781                        break;
782
783                    case ZEND_JMPZ:
784                    case ZEND_JMPNZ:
785                    case ZEND_JMPZ_EX:
786                    case ZEND_JMPNZ_EX:
787#ifdef ZEND_JMP_SET
788                    case ZEND_JMP_SET:
789#endif
790#ifdef ZEND_JMP_SET_VAR
791            case ZEND_JMP_SET_VAR:
792#endif
793#ifdef ZEND_ENGINE_2
794                        Z_OP(opline->op2).jmp_addr = &dst->opcodes[Z_OP(opline->op2).jmp_addr - src->opcodes];
795#endif
796                        break;
797
798                    default:
799                        break;
800                }
801            }
802        }
803        if (gc_arg_info || gc_opcodes) {
804            xc_gc_op_array_t gc_op_array;
805#ifdef ZEND_ENGINE_2
806            gc_op_array.num_args = gc_arg_info ? dst->num_args : 0;
807            gc_op_array.arg_info = gc_arg_info ? dst->arg_info : NULL;
808#endif
809            gc_op_array.opcodes  = gc_opcodes ? dst->opcodes : NULL;
810            xc_gc_add_op_array(&gc_op_array TSRMLS_CC);
811        }
812        IFAUTOCHECK(`xc_autocheck_skip = 1;')
813    }
814    else
815    ')
816    do {
817    dnl RESTORE is done above!
818
819    /* Common elements */
820    PROCESS(zend_uchar, type)
821    PROC_ZSTRING(, function_name)
822#ifdef ZEND_ENGINE_2
823    PROCESS(zend_uint, fn_flags)
824    STRUCT_ARRAY(zend_uint, num_args, zend_arg_info, arg_info)
825    PROCESS(zend_uint, num_args)
826    PROCESS(zend_uint, required_num_args)
827#   ifndef ZEND_ENGINE_2_4
828    PROCESS(zend_bool, pass_rest_by_reference)
829#   endif
830#else
831    if (src->arg_types) {
832        ALLOC(dst->arg_types, zend_uchar, src->arg_types[0] + 1)
833        IFCOPY(`memcpy(dst->arg_types, src->arg_types, sizeof(src->arg_types[0]) * (src->arg_types[0]+1));')
834        IFDASM(`do {
835            int i;
836            zval *zv;
837            ALLOC_INIT_ZVAL(zv);
838            array_init(zv);
839            for (i = 0; i < src->arg_types[0]; i ++) {
840                add_next_index_long(zv, src->arg_types[i + 1]);
841            }
842            add_assoc_zval_ex(dst, ZEND_STRS("arg_types"), zv);
843        } while (0);')
844        DONE(arg_types)
845    }
846    else {
847        COPYNULL(arg_types)
848    }
849#endif
850#ifndef ZEND_ENGINE_2_4
851    PROCESS(unsigned char, return_reference)
852#endif
853    /* END of common elements */
854#ifdef IS_UNICODE
855    dnl SETNULL(u_twin)
856#endif
857
858    STRUCT_P(zend_uint, refcount)
859    UNFIXPOINTER(zend_uint, refcount)
860    IFSTORE(`dst->refcount[0] = 1;')
861
862#ifdef ZEND_ENGINE_2_4
863    dnl used when copying opcodes
864    STRUCT_ARRAY(int, last_literal, zend_literal, literals)
865    PROCESS(int, last_literal)
866#endif
867
868    dnl uses literals
869    STRUCT_ARRAY(zend_uint, last, zend_op, opcodes)
870    PROCESS(zend_uint, last)
871#ifndef ZEND_ENGINE_2_4
872    IFCOPY(`dst->size = src->last;DONE(size)', `PROCESS(zend_uint, size)')
873#endif
874
875#ifdef IS_CV
876    STRUCT_ARRAY(int, last_var, zend_compiled_variable, vars)
877    PROCESS(int, last_var)
878#   ifndef ZEND_ENGINE_2_4
879    IFCOPY(`dst->size_var = src->last_var;DONE(size_var)', `PROCESS(zend_uint, size_var)')
880#   endif
881#else
882    dnl zend_cv.m4 is illegal to be made public, don not ask me for it
883    IFDASM(`
884        sinclude(srcdir`/processor/zend_cv.m4')
885        ')
886#endif
887
888    PROCESS(zend_uint, T)
889
890#ifdef ZEND_ENGINE_2_5
891    PROCESS(zend_uint, nested_calls)
892    PROCESS(zend_uint, used_stack)
893#endif
894
895    STRUCT_ARRAY(last_brk_cont_t, last_brk_cont, zend_brk_cont_element, brk_cont_array)
896    PROCESS(last_brk_cont_t, last_brk_cont)
897#ifndef ZEND_ENGINE_2_4
898    PROCESS(zend_uint, current_brk_cont)
899#endif
900#ifndef ZEND_ENGINE_2
901    PROCESS(zend_bool, uses_globals)
902#endif
903
904#ifdef ZEND_ENGINE_2
905    STRUCT_ARRAY(int, last_try_catch, zend_try_catch_element, try_catch_array)
906    PROCESS(int, last_try_catch)
907#endif
908#ifdef ZEND_ENGINE_2_5
909    PROCESS(zend_bool, has_finally_block)
910#endif
911
912    STRUCT_P(HashTable, static_variables, HashTable_zval_ptr)
913
914#ifndef ZEND_ENGINE_2_4
915    COPY(start_op)
916    PROCESS(int, backpatch_count)
917#endif
918#ifdef ZEND_ENGINE_2_3
919    PROCESS(zend_uint, this_var)
920#endif
921
922#ifndef ZEND_ENGINE_2_4
923    PROCESS(zend_bool, done_pass_two)
924#endif
925    /* 5.0 <= ver < 5.3 */
926#if defined(ZEND_ENGINE_2) && !defined(ZEND_ENGINE_2_3)
927    PROCESS(zend_bool, uses_this)
928#endif
929
930    IFRESTORE(`dst->filename = processor->entry_php_src->filepath;DONE(filename)', `PROC_STRING(filename)')
931#ifdef IS_UNICODE
932    IFRESTORE(`
933        COPY(script_encoding)
934    ', `
935        PROC_STRING(script_encoding)
936    ')
937#endif
938#ifdef ZEND_ENGINE_2
939    PROCESS(zend_uint, line_start)
940    PROCESS(zend_uint, line_end)
941    PROCESS(int, doc_comment_len)
942    PROC_ZSTRING_L(, doc_comment, doc_comment_len)
943#endif
944#ifdef ZEND_COMPILE_DELAYED_BINDING
945    PROCESS(zend_uint, early_binding);
946#endif
947
948    /* reserved */
949    DONE(reserved)
950#if defined(HARDENING_PATCH) && HARDENING_PATCH
951    PROCESS(zend_bool, created_by_eval)
952#endif
953#ifdef ZEND_ENGINE_2_4
954    SETNULL(run_time_cache)
955    PROCESS(int, last_cache_slot)
956#endif
957    } while (0);
958    IFRESTORE(`xc_fix_op_array_info(processor->entry_php_src, processor->php_src, dst, shallow_copy, op_array_info TSRMLS_CC);')
959
960#ifdef ZEND_ENGINE_2
961    dnl mark it as -1 on store, and lookup parent on restore
962    IFSTORE(`dst->prototype = (processor->active_class_entry_src && src->prototype) ? (zend_function *) -1 : NULL;', `
963        IFRESTORE(`do {
964            zend_function *parent;
965            if (src->prototype != NULL
966             && zend_u_hash_find(&(processor->active_class_entry_dst->parent->function_table),
967                    UG(unicode) ? IS_UNICODE : IS_STRING,
968                    src->function_name, xc_zstrlen(UG(unicode) ? IS_UNICODE : IS_STRING, src->function_name) + 1,
969                    (void **) &parent) == SUCCESS) {
970                /* see do_inherit_method_check() */
971                if ((parent->common.fn_flags & ZEND_ACC_ABSTRACT)) {
972                    dst->prototype = parent;
973                } else if (!(parent->common.fn_flags & ZEND_ACC_CTOR) || (parent->common.prototype && (parent->common.prototype->common.scope->ce_flags & ZEND_ACC_INTERFACE))) {
974                    /* ctors only have a prototype if it comes from an interface */
975                    dst->prototype = parent->common.prototype ? parent->common.prototype : parent;
976                }
977                else {
978                    dst->prototype = NULL;
979                }
980            }
981            else {
982                dst->prototype = NULL;
983            }
984        } while (0);
985        ')
986    ')
987    DONE(prototype)
988
989#endif
990
991#ifdef ZEND_ENGINE_2
992    PROC_CLASS_ENTRY_P(scope)
993    IFCOPY(`
994        if (src->scope) {
995            xc_fix_method(processor, dst TSRMLS_CC);
996        }
997    ')
998#endif
999
1000    IFRESTORE(`
1001        if (xc_have_op_array_ctor) {
1002            zend_llist_apply_with_argument(&zend_extensions, (llist_apply_with_arg_func_t) xc_zend_extension_op_array_ctor_handler, dst TSRMLS_CC);
1003        }
1004    ')
1005    }
1006    IFCOPY(`
1007        processor->active_op_array_dst = NULL;
1008        processor->active_op_array_src = NULL;
1009    ')
1010    IFDASM(`
1011        dasm->active_op_array_src = NULL;
1012    ')
1013')
1014dnl }}}
1015
1016#ifdef HAVE_XCACHE_CONSTANT
1017DEF_STRUCT_P_FUNC(`xc_constinfo_t', , `dnl {{{
1018    PROCESS(zend_uint, key_size)
1019#ifdef IS_UNICODE
1020    PROCESS(zend_uchar, type)
1021#endif
1022    IFRESTORE(`COPY(key)', `
1023        PROC_ZSTRING_N(type, key, key_size)
1024    ')
1025    PROCESS(ulong, h)
1026    STRUCT(zend_constant, constant)
1027')
1028dnl }}}
1029#endif
1030IFRESTORE(`', `
1031DEF_STRUCT_P_FUNC(`xc_op_array_info_detail_t', , `dnl {{{
1032    PROCESS(zend_uint, index)
1033    PROCESS(zend_uint, info)
1034')
1035dnl }}}
1036DEF_STRUCT_P_FUNC(`xc_op_array_info_t', , `dnl {{{
1037#ifdef ZEND_ENGINE_2_4
1038    PROCESS(zend_uint, literalinfo_cnt)
1039    STRUCT_ARRAY(zend_uint, literalinfo_cnt, xc_op_array_info_detail_t, literalinfos)
1040#else
1041    PROCESS(zend_uint, oplineinfo_cnt)
1042    STRUCT_ARRAY(zend_uint, oplineinfo_cnt, xc_op_array_info_detail_t, oplineinfos)
1043#endif
1044')
1045dnl }}}
1046')
1047DEF_STRUCT_P_FUNC(`xc_funcinfo_t', , `dnl {{{
1048    PROCESS(zend_uint, key_size)
1049#ifdef IS_UNICODE
1050    PROCESS(zend_uchar, type)
1051#endif
1052    IFRESTORE(`COPY(key)', `
1053        PROC_ZSTRING_N(type, key, key_size)
1054    ')
1055    PROCESS(ulong, h)
1056    IFRESTORE(`COPY(op_array_info)', `
1057        STRUCT(xc_op_array_info_t, op_array_info)
1058    ')
1059    IFRESTORE(`
1060        processor->active_op_array_infos_src = &src->op_array_info;
1061        processor->active_op_array_index = 0;
1062    ')
1063    STRUCT(zend_function, func)
1064')
1065dnl }}}
1066DEF_STRUCT_P_FUNC(`xc_classinfo_t', , `dnl {{{
1067    PROCESS(zend_uint, key_size)
1068#ifdef IS_UNICODE
1069    PROCESS(zend_uchar, type)
1070#endif
1071    IFRESTORE(`COPY(key)', `
1072        PROC_ZSTRING_N(type, key, key_size)
1073    ')
1074    PROCESS(ulong, h)
1075    PROCESS(zend_uint, methodinfo_cnt)
1076    IFRESTORE(`COPY(methodinfos)', `
1077        STRUCT_ARRAY(zend_uint, methodinfo_cnt, xc_op_array_info_t, methodinfos)
1078    ')
1079    IFRESTORE(`
1080        processor->active_op_array_infos_src = src->methodinfos;
1081        processor->active_op_array_index = 0;
1082    ')
1083#ifdef ZEND_ENGINE_2
1084    STRUCT_P(zend_class_entry, cest)
1085#else
1086    STRUCT(zend_class_entry, cest)
1087#endif
1088#ifndef ZEND_COMPILE_DELAYED_BINDING
1089    PROCESS(int, oplineno)
1090#endif
1091')
1092dnl }}}
1093IFRESTORE(`', `
1094#ifdef ZEND_ENGINE_2_1
1095DEF_STRUCT_P_FUNC(`xc_autoglobal_t', , `dnl {{{
1096    PROCESS(zend_uint, key_len)
1097#ifdef IS_UNICODE
1098    PROCESS(zend_uchar, type)
1099#endif
1100    IFRESTORE(`COPY(key)', `
1101        PROC_ZSTRING_L(type, key, key_len)
1102    ')
1103    PROCESS(ulong, h)
1104')
1105dnl }}}
1106#endif
1107')
1108IFRESTORE(`', `
1109#ifdef XCACHE_ERROR_CACHING
1110DEF_STRUCT_P_FUNC(`xc_compilererror_t', , `dnl {{{
1111    PROCESS(int, type)
1112    PROCESS(uint, lineno)
1113    PROCESS(int, error_len)
1114    PROC_STRING_L(error, error_len)
1115')
1116dnl }}}
1117#endif
1118')
1119DEF_STRUCT_P_FUNC(`xc_entry_data_php_t', , `dnl {{{
1120    IFCOPY(`
1121        processor->php_dst = dst;
1122        processor->php_src = src;
1123    ')
1124
1125    /* skip */
1126    DONE(next)
1127    PROCESS(xc_hash_value_t, hvalue)
1128    PROCESS(xc_md5sum_t, md5)
1129    PROCESS(zend_ulong, refcount)
1130
1131    PROCESS(zend_ulong, hits)
1132    PROCESS(size_t, size)
1133
1134    IFRESTORE(`COPY(op_array_info)', `
1135        STRUCT(xc_op_array_info_t, op_array_info)
1136    ')
1137    IFRESTORE(`
1138        processor->active_op_array_infos_src = &dst->op_array_info;
1139        processor->active_op_array_index = 0;
1140    ')
1141    STRUCT_P(zend_op_array, op_array)
1142
1143#ifdef HAVE_XCACHE_CONSTANT
1144    PROCESS(zend_uint, constinfo_cnt)
1145    STRUCT_ARRAY(zend_uint, constinfo_cnt, xc_constinfo_t, constinfos)
1146#endif
1147
1148    PROCESS(zend_uint, funcinfo_cnt)
1149    STRUCT_ARRAY(zend_uint, funcinfo_cnt, xc_funcinfo_t, funcinfos)
1150
1151    PROCESS(zend_uint, classinfo_cnt)
1152    STRUCT_ARRAY(zend_uint, classinfo_cnt, xc_classinfo_t, classinfos, , IFRESTORE(`processor->active_class_index'))
1153#ifdef ZEND_ENGINE_2_1
1154    PROCESS(zend_uint, autoglobal_cnt)
1155    IFRESTORE(`
1156        COPY(autoglobals)
1157    ', `
1158        STRUCT_ARRAY(zend_uint, autoglobal_cnt, xc_autoglobal_t, autoglobals)
1159    ')
1160#endif
1161#ifdef XCACHE_ERROR_CACHING
1162    PROCESS(zend_uint, compilererror_cnt)
1163    IFRESTORE(`
1164        COPY(compilererrors)
1165    ', `
1166        STRUCT_ARRAY(zend_uint, compilererror_cnt, xc_compilererror_t, compilererrors)
1167    ')
1168#endif
1169#ifndef ZEND_COMPILE_DELAYED_BINDING
1170    PROCESS(zend_bool, have_early_binding)
1171#endif
1172    PROCESS(zend_bool, have_references)
1173')
1174dnl }}}
1175DEF_STRUCT_P_FUNC(`xc_entry_t', , `dnl {{{
1176    /* skip */
1177    DONE(next)
1178    PROCESS(size_t, size)
1179
1180    PROCESS(time_t, ctime)
1181    PROCESS(time_t, atime)
1182    PROCESS(time_t, dtime)
1183    PROCESS(long, ttl)
1184    PROCESS(zend_ulong, hits)
1185    DONE(name) dnl handle in xc_entry_php_t and xc_entry_var_t
1186')
1187dnl }}}
1188DEF_STRUCT_P_FUNC(`xc_entry_php_t', , `dnl {{{
1189    STRUCT(xc_entry_t, entry)
1190    DISABLECHECK(`
1191        PROCESS(int, entry.name.str.len)
1192        IFRESTORE(`COPY(entry.name.str.val)', `
1193            PROC_STRING_L(entry.name.str.val, entry.name.str.len)
1194        ')
1195    ')
1196
1197    IFCALCCOPY(`COPY(php)', `STRUCT_P(xc_entry_data_php_t, php)')
1198
1199    IFSTORE(`dst->refcount = 0; DONE(refcount)', `PROCESS(long, refcount)')
1200    PROCESS(time_t, file_mtime)
1201    PROCESS(size_t, file_size)
1202    PROCESS(size_t, file_device)
1203    PROCESS(size_t, file_inode)
1204
1205    PROCESS(size_t, filepath_len)
1206    IFRESTORE(`COPY(filepath)', `PROC_STRING_L(filepath, filepath_len)')
1207    PROCESS(size_t, dirpath_len)
1208    IFRESTORE(`COPY(dirpath)', `PROC_STRING_L(dirpath, dirpath_len)')
1209#ifdef IS_UNICODE
1210    PROCESS(int, ufilepath_len)
1211    IFRESTORE(`COPY(ufilepath)', `PROC_USTRING_L(ufilepath, ufilepath_len)')
1212    PROCESS(int, udirpath_len)
1213    IFRESTORE(`COPY(udirpath)', `PROC_USTRING_L(udirpath, udirpath_len)')
1214#endif
1215')
1216dnl }}}
1217DEF_STRUCT_P_FUNC(`xc_entry_var_t', , `dnl {{{
1218    STRUCT(xc_entry_t, entry)
1219
1220#ifdef IS_UNICODE
1221    PROCESS(zend_uchar, name_type)
1222#endif
1223    dnl {{{ entry.name
1224    DISABLECHECK(`
1225#ifdef IS_UNICODE
1226        if (src->name_type == IS_UNICODE) {
1227            PROCESS(int32_t, entry.name.ustr.len)
1228        }
1229        else {
1230            PROCESS(int, entry.name.str.len)
1231        }
1232#else
1233        PROCESS(int, entry.name.str.len)
1234#endif
1235        IFRESTORE(`COPY(entry.name.str.val)', `
1236#ifdef IS_UNICODE
1237            PROC_ZSTRING_L(name_type, entry.name.uni.val, entry.name.uni.len)
1238#else
1239            PROC_STRING_L(entry.name.str.val, entry.name.str.len)
1240#endif
1241        ')
1242    ')
1243    dnl }}}
1244
1245    IFDPRINT(`INDENT()`'fprintf(stderr, "zval:value");')
1246    STRUCT_P_EX(zval_ptr, dst->value, src->value, `value', `', `&')
1247    PROCESS(zend_bool, have_references)
1248    DONE(value)
1249')
1250dnl }}}
1251dnl ====================================================
Note: See TracBrowser for help on using the repository browser.