From c4016ecd446ef26bb3dc77735b6e441e151ea985 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Thu, 3 Sep 2020 11:30:58 +0200 Subject: [PATCH] Remove CG(filenames_table) This doesn't seem to serve any purpose anymore. --- Zend/zend_compile.c | 13 ------------- Zend/zend_globals.h | 2 -- 2 files changed, 15 deletions(-) diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index c403a1f54e3..a60ceb1c843 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -412,7 +412,6 @@ void init_compiler(void) /* {{{ */ memset(&CG(context), 0, sizeof(CG(context))); zend_init_compiler_data_structures(); zend_init_rsrc_list(); - zend_hash_init(&CG(filenames_table), 8, NULL, ZVAL_PTR_DTOR, 0); zend_llist_init(&CG(open_files), sizeof(zend_file_handle), (void (*)(void *)) file_handle_dtor, 0); CG(unclean_shutdown) = 0; @@ -426,7 +425,6 @@ void shutdown_compiler(void) /* {{{ */ zend_stack_destroy(&CG(loop_var_stack)); zend_stack_destroy(&CG(delayed_oplines_stack)); zend_stack_destroy(&CG(short_circuiting_opnums)); - zend_hash_destroy(&CG(filenames_table)); zend_arena_destroy(CG(arena)); if (CG(delayed_variance_obligations)) { @@ -444,18 +442,7 @@ void shutdown_compiler(void) /* {{{ */ ZEND_API zend_string *zend_set_compiled_filename(zend_string *new_compiled_filename) /* {{{ */ { - zval *p, rv; - - if ((p = zend_hash_find(&CG(filenames_table), new_compiled_filename))) { - ZEND_ASSERT(Z_TYPE_P(p) == IS_STRING); - CG(compiled_filename) = Z_STR_P(p); - return Z_STR_P(p); - } - new_compiled_filename = zend_new_interned_string(zend_string_copy(new_compiled_filename)); - ZVAL_STR(&rv, new_compiled_filename); - zend_hash_add_new(&CG(filenames_table), new_compiled_filename, &rv); - CG(compiled_filename) = new_compiled_filename; return new_compiled_filename; } diff --git a/Zend/zend_globals.h b/Zend/zend_globals.h index 652e0ef1e13..e0e8ac77006 100644 --- a/Zend/zend_globals.h +++ b/Zend/zend_globals.h @@ -77,8 +77,6 @@ struct _zend_compiler_globals { HashTable *function_table; /* function symbol table */ HashTable *class_table; /* class table */ - HashTable filenames_table; - HashTable *auto_globals; /* Refer to zend_yytnamerr() in zend_language_parser.y for meaning of values */