Changeset 291 for eaccelerator/trunk/ea_restore.c
- Timestamp:
- 02/13/07 16:11:14 (2 years ago)
- Files:
-
- eaccelerator/trunk/ea_restore.c (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
eaccelerator/trunk/ea_restore.c
r290 r291 583 583 } 584 584 #endif 585 to->opcodes = from->opcodes; 586 to->last = to->size = from->last; 587 to->T = from->T; 588 to->brk_cont_array = from->brk_cont_array; 589 to->last_brk_cont = from->last_brk_cont; 590 591 to->current_brk_cont = -1; 592 to->static_variables = from->static_variables; 593 /* to->start_op = to->opcodes; */ 594 to->backpatch_count = 0; 595 596 to->return_reference = from->return_reference; 597 to->done_pass_two = 1; 598 to->filename = from->filename; 599 /* if (from->filename != NULL) { 600 size_t len = strlen(from->filename) + 1; 601 to->filename = emalloc(len); 602 memcpy(to->filename, from->filename, len); 603 }*/ 604 605 #ifdef ZEND_ENGINE_2 606 /* HOESH: try & catch support */ 607 to->try_catch_array = from->try_catch_array; 608 to->last_try_catch = from->last_try_catch; 585 to->opcodes = from->opcodes; 586 to->last = to->size = from->last; 587 to->T = from->T; 588 to->brk_cont_array = from->brk_cont_array; 589 to->last_brk_cont = from->last_brk_cont; 590 591 to->current_brk_cont = -1; 592 to->static_variables = from->static_variables; 593 to->backpatch_count = 0; 594 595 to->return_reference = from->return_reference; 596 to->done_pass_two = 1; 597 to->filename = from->filename; 598 599 #ifdef ZEND_ENGINE_2 600 to->try_catch_array = from->try_catch_array; 601 to->last_try_catch = from->last_try_catch; 609 602 to->uses_this = from->uses_this; 610 603 … … 639 632 to->last_var = from->last_var; 640 633 to->size_var = 0; 641 /* if (from->vars) {642 zend_uint i;643 to->vars = (zend_compiled_variable*)emalloc(from->last_var*sizeof(zend_compiled_variable));644 memcpy(to->vars, from->vars, sizeof(zend_compiled_variable) * from->last_var);645 for (i = 0; i < from->last_var; i ++) {646 to->vars[i].name = estrndup(from->vars[i].name, from->vars[i].name_len);647 }648 }*/649 634 #endif 650 635 … … 795 780 memset(to, 0, sizeof(zend_class_entry)); 796 781 to->type = from->type; 797 /*798 to->name = NULL;799 to->name_length = from->name_length;800 to->constants_updated = 0;801 to->parent = NULL;802 */803 #ifdef ZEND_ENGINE_2804 to->ce_flags = from->ce_flags;805 to->num_interfaces = from->num_interfaces;806 to->interfaces = NULL;807 808 if (to->num_interfaces > 0) {809 /* hrak: Allocate the slots which will later be populated by ZEND_ADD_INTERFACE */810 to->interfaces = (zend_class_entry **) emalloc(sizeof(zend_class_entry *) * to->num_interfaces);811 memset(to->interfaces, 0, sizeof(zend_class_entry *) * to->num_interfaces);812 }813 #endif814 782 815 783 if (from->name != NULL) { … … 823 791 824 792 #ifdef ZEND_ENGINE_2 793 to->ce_flags = from->ce_flags; 794 to->num_interfaces = from->num_interfaces; 795 to->interfaces = NULL; 825 796 to->refcount = 1; 826 827 797 to->line_start = from->line_start; 828 798 to->line_end = from->line_end; 799 800 if (to->num_interfaces > 0) { 801 /* hrak: Allocate the slots which will later be populated by ZEND_ADD_INTERFACE */ 802 to->interfaces = (zend_class_entry **) emalloc(sizeof(zend_class_entry *) * to->num_interfaces); 803 memset(to->interfaces, 0, sizeof(zend_class_entry *) * to->num_interfaces); 804 } 829 805 #ifdef INCLUDE_DOC_COMMENTS 830 806 to->doc_comment_len = from->doc_comment_len; 807 if (from->doc_comment != NULL) { 808 to->doc_comment = emalloc(from->doc_comment_len + 1); 809 memcpy(to->doc_comment, from->doc_comment, from->doc_comment_len + 1); 810 } 831 811 #else 832 812 to->doc_comment_len = 0; 833 813 to->doc_comment = NULL; 834 814 #endif 835 /* if (from->filename != NULL) { 836 size_t len = strlen(from->filename) + 1; 837 to->filename = emalloc(len); 838 memcpy(to->filename, from->filename, len); 839 }*/ 840 to->filename = from->filename; 841 #ifdef INCLUDE_DOC_COMMENTS 842 if (from->doc_comment != NULL) { 843 to->doc_comment = emalloc(from->doc_comment_len + 1); 844 memcpy(to->doc_comment, from->doc_comment, from->doc_comment_len + 1); 845 } 846 #endif 815 816 to->filename = from->filename; 847 817 848 818 /* restore constants table */ … … 853 823 to->default_properties.pDestructor = ZVAL_PTR_DTOR; 854 824 /* restore properties */ 855 restore_hash(&to->properties_info, &from->properties_info, 856 (restore_bucket_t) restore_property_info TSRMLS_CC); 825 restore_hash(&to->properties_info, &from->properties_info, (restore_bucket_t) restore_property_info TSRMLS_CC); 857 826 to->properties_info.pDestructor = properties_info_dtor; 858 827 … … 891 860 } 892 861 #endif 862 893 863 if (from->parent != NULL) { 894 864 restore_class_parent(from->parent, strlen(from->parent), to TSRMLS_CC); … … 905 875 restore_class_methods(to TSRMLS_CC); 906 876 #endif 907 if (to->parent) 877 878 if (to->parent) { 908 879 #ifdef ZEND_ENGINE_2 909 880 zend_do_inheritance(to, to->parent TSRMLS_CC); … … 911 882 zend_do_inheritance(to, to->parent); 912 883 #endif 884 } 913 885 EAG(class_entry) = old; 914 886