Changeset 709 in svn for trunk/disassembler.c


Ignore:
Timestamp:
2011-04-08T04:08:37Z (4 years ago)
Author:
Xuefer
Message:

disassembler: don't dump builtin functions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/disassembler.c

    r504 r709  
    66#define return_value dst
    77
     8/* sandbox {{{ */
     9#undef TG
     10#undef OG
     11#define TG(x) (sandbox->tmp_##x)
     12#define OG(x) (sandbox->orig_##x)
     13/* }}} */
     14
    815#ifndef HAVE_XCACHE_OPCODE_SPEC_DEF
    916#error disassembler cannot be built without xcache/opcode_spec_def.h
    1017#endif
    11 static void xc_dasm(zval *dst, zend_op_array *op_array TSRMLS_DC) /* {{{ */
     18static void xc_dasm(xc_sandbox_t *sandbox, zval *dst, zend_op_array *op_array TSRMLS_DC) /* {{{ */
    1219{
    1320    Bucket *b;
     
    3340    ALLOC_INIT_ZVAL(list);
    3441    array_init(list);
    35     xc_dasm_HashTable_zend_function(list, CG(function_table) TSRMLS_CC);
     42    b = TG(internal_function_tail) ? TG(internal_function_tail)->pListNext : TG(function_table).pListHead;
     43    for (; b; b = b->pListNext) {
     44        ALLOC_INIT_ZVAL(zv);
     45        array_init(zv);
     46        xc_dasm_zend_function(zv, b->pData TSRMLS_CC);
     47
     48        add_u_assoc_zval_ex(list, BUCKET_KEY_TYPE(b), b->arKey, b->nKeyLength, zv);
     49    }
    3650    add_assoc_zval_ex(dst, ZEND_STRS("function_table"), list);
    3751   
     
    3953    ALLOC_INIT_ZVAL(list);
    4054    array_init(list);
    41     for (b = CG(class_table)->pListHead; b; b = b->pListNext) {
     55    b = TG(internal_class_tail) ? TG(internal_class_tail)->pListNext : TG(class_table).pListHead;
     56    for (; b; b = b->pListNext) {
    4257        ALLOC_INIT_ZVAL(zv);
    4358        array_init(zv);
     
    97112    }
    98113
    99     xc_dasm(dst, op_array TSRMLS_CC);
     114    xc_dasm(&sandbox, dst, op_array TSRMLS_CC);
    100115
    101116    /* free */
     
    142157    }
    143158
    144     xc_dasm(dst, op_array TSRMLS_CC);
     159    xc_dasm(&sandbox, dst, op_array TSRMLS_CC);
    145160
    146161    /* free */
Note: See TracChangeset for help on using the changeset viewer.