Ignore:
Timestamp:
2014-05-27T17:48:37+02:00 (7 months ago)
Author:
moo
Message:

Decompiler PHP_5_6: updated support for zend_ast

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/mod_disassembler/xc_disassembler.c

    r1477 r1488  
    237237/* }}} */ 
    238238 
     239#ifdef IS_CONSTANT_AST 
     240/* {{{ proto array xcache_dasm_ast(mixed ast) 
     241   Disassemble zend_ast data into array */ 
     242#ifdef ZEND_BEGIN_ARG_INFO_EX 
     243ZEND_BEGIN_ARG_INFO_EX(arginfo_xcache_dasm_ast, 0, 0, 1) 
     244    ZEND_ARG_INFO(0, ast) 
     245ZEND_END_ARG_INFO() 
     246#else 
     247static unsigned char arginfo_xcache_dasm_ast[] = { 1, BYREF_NONE }; 
     248#endif 
     249 
     250PHP_FUNCTION(xcache_dasm_ast) 
     251{ 
     252    zval *ast; 
     253    xc_dasm_t dasm; 
     254 
     255    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &ast) == FAILURE) { 
     256        return; 
     257    } 
     258    if ((Z_TYPE_P(ast) & IS_CONSTANT_TYPE_MASK) != IS_CONSTANT_AST) { 
     259        php_error_docref(NULL TSRMLS_CC, E_ERROR, "Data type is not zend_ast"); 
     260        return; 
     261    } 
     262    array_init(return_value); 
     263    xc_dasm_zend_ast(&dasm, return_value, ast->value.ast TSRMLS_CC); 
     264} 
     265/* }}} */ 
     266#endif 
     267 
    239268/* {{{ PHP_MINFO_FUNCTION(xcache_disassembler) */ 
    240269static PHP_MINFO_FUNCTION(xcache_disassembler) 
     
    251280    PHP_FE(xcache_dasm_file,         arginfo_xcache_dasm_file) 
    252281    PHP_FE(xcache_dasm_string,       arginfo_xcache_dasm_string) 
     282#ifdef IS_CONSTANT_AST 
     283    PHP_FE(xcache_dasm_ast,          arginfo_xcache_dasm_ast) 
     284#endif 
    253285    PHP_FE_END 
    254286}; 
Note: See TracChangeset for help on using the changeset viewer.