Changeset 937 for trunk/utils.c
- Timestamp:
- 2012-06-28T11:38:30+02:00 (11 months ago)
- File:
-
- 1 edited
-
trunk/utils.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/utils.c
r935 r937 582 582 /* }}} */ 583 583 584 /* sandbox {{{ */ 584 typedef struct { /* sandbox {{{ */ 585 ZEND_24(NOTHING, const) char *filename; 586 587 HashTable orig_included_files; 588 HashTable *tmp_included_files; 589 590 #ifdef HAVE_XCACHE_CONSTANT 591 HashTable *orig_zend_constants; 592 HashTable tmp_zend_constants; 593 #endif 594 HashTable *orig_function_table; 595 HashTable *orig_class_table; 596 HashTable *orig_auto_globals; 597 HashTable tmp_function_table; 598 HashTable tmp_class_table; 599 HashTable tmp_auto_globals; 600 #ifdef HAVE_XCACHE_CONSTANT 601 Bucket *tmp_internal_constant_tail; 602 #endif 603 Bucket *tmp_internal_function_tail; 604 Bucket *tmp_internal_class_tail; 605 606 #ifdef XCACHE_ERROR_CACHING 607 int orig_user_error_handler_error_reporting; 608 zend_uint compilererror_cnt; 609 zend_uint compilererror_size; 610 xc_compilererror_t *compilererrors; 611 #endif 612 613 #ifdef ZEND_COMPILE_IGNORE_INTERNAL_CLASSES 614 zend_uint orig_compiler_options; 615 #endif 616 } xc_sandbox_t; 617 585 618 #undef TG 586 619 #undef OG … … 731 764 /* }}} */ 732 765 #endif 766 733 767 xc_sandbox_t *xc_sandbox_init(xc_sandbox_t *sandbox, ZEND_24(NOTHING, const) char *filename TSRMLS_DC) /* {{{ */ 734 768 { … … 825 859 /* }}} */ 826 860 #endif 827 static void xc_sandbox_install(xc_sandbox_t *sandbox , xc_install_action_t installTSRMLS_DC) /* {{{ */861 static void xc_sandbox_install(xc_sandbox_t *sandbox TSRMLS_DC) /* {{{ */ 828 862 { 829 863 zend_uint i; … … 874 908 #endif 875 909 876 if (install != XC_InstallNoBinding) {877 910 #ifdef ZEND_COMPILE_DELAYED_BINDING 878 zend_do_delayed_early_binding(CG(active_op_array) TSRMLS_CC); 879 #else 880 xc_undo_pass_two(CG(active_op_array) TSRMLS_CC); 881 xc_foreach_early_binding_class(CG(active_op_array), xc_early_binding_cb, (void *) sandbox TSRMLS_CC); 882 xc_redo_pass_two(CG(active_op_array) TSRMLS_CC); 883 #endif 884 } 911 zend_do_delayed_early_binding(CG(active_op_array) TSRMLS_CC); 912 #else 913 xc_undo_pass_two(CG(active_op_array) TSRMLS_CC); 914 xc_foreach_early_binding_class(CG(active_op_array), xc_early_binding_cb, (void *) sandbox TSRMLS_CC); 915 xc_redo_pass_two(CG(active_op_array) TSRMLS_CC); 916 #endif 885 917 886 918 #ifdef XCACHE_ERROR_CACHING … … 898 930 } 899 931 /* }}} */ 900 void xc_sandbox_free(xc_sandbox_t *sandbox, xc_install_action_t installTSRMLS_DC) /* {{{ */932 void xc_sandbox_free(xc_sandbox_t *sandbox, zend_op_array *op_array TSRMLS_DC) /* {{{ */ 901 933 { 902 934 XG(sandbox) = NULL; … … 916 948 #endif 917 949 918 if (install != XC_NoInstall) { 950 if (op_array) { 951 zend_op_array *old_active_op_array = CG(active_op_array); 919 952 CG(in_compilation) = 1; 920 953 CG(compiled_filename) = ZEND_24(NOTHING, (char *)) sandbox->filename; 921 954 CG(zend_lineno) = 0; 922 xc_sandbox_install(sandbox, install TSRMLS_CC); 955 956 CG(active_op_array) = op_array; 957 xc_sandbox_install(sandbox TSRMLS_CC); 958 CG(active_op_array) = old_active_op_array; 959 923 960 CG(in_compilation) = 0; 924 961 CG(compiled_filename) = NULL; … … 961 998 } 962 999 /* }}} */ 1000 const Bucket *xc_sandbox_user_function_begin() /* {{{ */ 1001 { 1002 xc_sandbox_t *sandbox = (xc_sandbox_t *) XG(sandbox); 1003 assert(sandbox); 1004 return TG(internal_function_tail) ? TG(internal_function_tail)->pListNext : TG(function_table).pListHead; 1005 } /* {{{ */ 1006 const Bucket *xc_sandbox_user_class_begin() /* {{{ */ 1007 { 1008 xc_sandbox_t *sandbox = (xc_sandbox_t *) XG(sandbox); 1009 assert(sandbox); 1010 return TG(internal_class_tail) ? TG(internal_class_tail)->pListNext : TG(class_table).pListHead; 1011 } /* {{{ */ 1012 #ifdef XCACHE_ERROR_CACHING 1013 xc_compilererror_t *xc_sandbox_compilererrors() /* {{{ */ 1014 { 1015 xc_sandbox_t *sandbox = (xc_sandbox_t *) XG(sandbox); 1016 assert(sandbox); 1017 return sandbox->compilererrors; 1018 } /* }}} */ 1019 zend_uint xc_sandbox_compilererror_cnt() /* {{{ */ 1020 { 1021 xc_sandbox_t *sandbox = (xc_sandbox_t *) XG(sandbox); 1022 assert(sandbox); 1023 return sandbox->compilererror_cnt; 1024 } /* }}} */ 1025 #endif 1026 1027 963 1028 int xc_vtrace(const char *fmt, va_list args) /* {{{ */ 964 1029 {
Note: See TracChangeset
for help on using the changeset viewer.

