Changeset 938
Legend:
- Unmodified
- Added
- Removed
-
trunk/disassembler.c
r937 r938 33 33 ALLOC_INIT_ZVAL(list); 34 34 array_init(list); 35 for (b = xc_sandbox_user_function_begin( ); b; b = b->pListNext) {35 for (b = xc_sandbox_user_function_begin(TSRMLS_C); b; b = b->pListNext) { 36 36 int keysize, keyLength; 37 37 … … 69 69 ALLOC_INIT_ZVAL(list); 70 70 array_init(list); 71 for (b = xc_sandbox_user_class_begin( ); b; b = b->pListNext) {71 for (b = xc_sandbox_user_class_begin(TSRMLS_C); b; b = b->pListNext) { 72 72 int keysize, keyLength; 73 73 -
trunk/utils.c
r937 r938 765 765 #endif 766 766 767 xc_sandbox_t *xc_sandbox_init(xc_sandbox_t *sandbox, ZEND_24(NOTHING, const) char *filename TSRMLS_DC) /* {{{ */767 static xc_sandbox_t *xc_sandbox_init(xc_sandbox_t *sandbox, ZEND_24(NOTHING, const) char *filename TSRMLS_DC) /* {{{ */ 768 768 { 769 769 HashTable *h; … … 930 930 } 931 931 /* }}} */ 932 void xc_sandbox_free(xc_sandbox_t *sandbox, zend_op_array *op_array TSRMLS_DC) /* {{{ */932 static void xc_sandbox_free(xc_sandbox_t *sandbox, zend_op_array *op_array TSRMLS_DC) /* {{{ */ 933 933 { 934 934 XG(sandbox) = NULL; … … 998 998 } 999 999 /* }}} */ 1000 const Bucket *xc_sandbox_user_function_begin() /* {{{ */ 1000 zend_op_array *xc_sandbox(xc_sandboxed_func_t sandboxed_func, void *data, ZEND_24(NOTHING, const) char *filename TSRMLS_DC) /* {{{ */ 1001 { 1002 xc_sandbox_t sandbox; 1003 zend_op_array *op_array = NULL; 1004 zend_bool catched = 0; 1005 1006 memset(&sandbox, 0, sizeof(sandbox)); 1007 zend_try { 1008 xc_sandbox_init(&sandbox, filename TSRMLS_CC); 1009 op_array = sandboxed_func(data TSRMLS_CC); 1010 } zend_catch { 1011 catched = 1; 1012 } zend_end_try(); 1013 1014 xc_sandbox_free(&sandbox, op_array TSRMLS_CC); 1015 if (catched) { 1016 zend_bailout(); 1017 } 1018 return op_array; 1019 } 1020 /* {{{ */ 1021 const Bucket *xc_sandbox_user_function_begin(TSRMLS_D) /* {{{ */ 1001 1022 { 1002 1023 xc_sandbox_t *sandbox = (xc_sandbox_t *) XG(sandbox); 1003 1024 assert(sandbox); 1004 1025 return TG(internal_function_tail) ? TG(internal_function_tail)->pListNext : TG(function_table).pListHead; 1005 } /* {{{ */ 1006 const Bucket *xc_sandbox_user_class_begin() /* {{{ */ 1026 } 1027 /* {{{ */ 1028 const Bucket *xc_sandbox_user_class_begin(TSRMLS_D) /* {{{ */ 1007 1029 { 1008 1030 xc_sandbox_t *sandbox = (xc_sandbox_t *) XG(sandbox); 1009 1031 assert(sandbox); 1010 1032 return TG(internal_class_tail) ? TG(internal_class_tail)->pListNext : TG(class_table).pListHead; 1011 } /* {{{ */ 1033 } 1034 /* {{{ */ 1012 1035 #ifdef XCACHE_ERROR_CACHING 1013 xc_compilererror_t *xc_sandbox_compilererrors( ) /* {{{ */1036 xc_compilererror_t *xc_sandbox_compilererrors(TSRMLS_D) /* {{{ */ 1014 1037 { 1015 1038 xc_sandbox_t *sandbox = (xc_sandbox_t *) XG(sandbox); 1016 1039 assert(sandbox); 1017 1040 return sandbox->compilererrors; 1018 } /* }}} */ 1019 zend_uint xc_sandbox_compilererror_cnt() /* {{{ */ 1041 } 1042 /* }}} */ 1043 zend_uint xc_sandbox_compilererror_cnt(TSRMLS_D) /* {{{ */ 1020 1044 { 1021 1045 xc_sandbox_t *sandbox = (xc_sandbox_t *) XG(sandbox); 1022 1046 assert(sandbox); 1023 1047 return sandbox->compilererror_cnt; 1024 } /* }}} */1025 #endif 1026 1048 } 1049 /* }}} */ 1050 #endif 1027 1051 1028 1052 int xc_vtrace(const char *fmt, va_list args) /* {{{ */ -
trunk/utils.h
r937 r938 83 83 typedef zend_op_array *(*xc_sandboxed_func_t)(void *data TSRMLS_DC); 84 84 zend_op_array *xc_sandbox(xc_sandboxed_func_t sandboxed_func, void *data, ZEND_24(NOTHING, const) char *filename TSRMLS_DC); 85 const Bucket *xc_sandbox_user_function_begin( );86 const Bucket *xc_sandbox_user_class_begin( );87 zend_uint xc_sandbox_compilererror_cnt( );85 const Bucket *xc_sandbox_user_function_begin(TSRMLS_D); 86 const Bucket *xc_sandbox_user_class_begin(TSRMLS_D); 87 zend_uint xc_sandbox_compilererror_cnt(TSRMLS_D); 88 88 #ifdef XCACHE_ERROR_CACHING 89 xc_compilererror_t *xc_sandbox_compilererrors( );90 zend_uint xc_sandbox_compilererror_cnt( );89 xc_compilererror_t *xc_sandbox_compilererrors(TSRMLS_D); 90 zend_uint xc_sandbox_compilererror_cnt(TSRMLS_D); 91 91 #endif 92 92 -
trunk/xcache.c
r937 r938 1810 1810 /* }}} */ 1811 1811 #ifdef XCACHE_ERROR_CACHING 1812 compiler->new_php.compilererrors = xc_sandbox_compilererrors( );1813 compiler->new_php.compilererror_cnt = xc_sandbox_compilererror_cnt( );1812 compiler->new_php.compilererrors = xc_sandbox_compilererrors(TSRMLS_C); 1813 compiler->new_php.compilererror_cnt = xc_sandbox_compilererror_cnt(TSRMLS_C); 1814 1814 #endif 1815 1815 #ifndef ZEND_COMPILE_DELAYED_BINDING

