Drop free_filename field from zend_file_handle

free_filename was always zero.
This commit is contained in:
Nikita Popov 2019-07-16 16:50:22 +02:00
parent 49bac9b77b
commit e0eca26285
7 changed files with 0 additions and 17 deletions

View File

@ -292,9 +292,6 @@ ZEND_API void zend_destroy_file_handle(zend_file_handle *file_handle)
zend_llist_del_element(&CG(open_files), file_handle, (int (*)(void *, void *)) zend_compare_file_handles);
/* zend_file_handle_dtor() operates on the copy, so we have to NULLify the original here */
file_handle->opened_path = NULL;
if (file_handle->free_filename) {
file_handle->filename = NULL;
}
}
ZEND_API void zend_lex_tstring(zval *zv)

View File

@ -116,7 +116,6 @@ ZEND_API int zend_stream_open(const char *filename, zend_file_handle *handle) /*
handle->opened_path = NULL;
handle->handle.fp = zend_fopen(filename, &handle->opened_path);
handle->filename = filename;
handle->free_filename = 0;
memset(&handle->handle.stream.mmap, 0, sizeof(zend_mmap));
return (handle->handle.fp) ? SUCCESS : FAILURE;
@ -261,10 +260,6 @@ ZEND_API void zend_file_handle_dtor(zend_file_handle *fh) /* {{{ */
zend_string_release_ex(fh->opened_path, 0);
fh->opened_path = NULL;
}
if (fh->free_filename && fh->filename) {
efree((char*)fh->filename);
fh->filename = NULL;
}
}
/* }}} */

View File

@ -65,7 +65,6 @@ typedef struct _zend_file_handle {
const char *filename;
zend_string *opened_path;
zend_stream_type type;
zend_bool free_filename;
} zend_file_handle;
BEGIN_EXTERN_C()

View File

@ -3261,7 +3261,6 @@ static zend_op_array *phar_compile_file(zend_file_handle *file_handle, int type)
efree(f.opened_path);
}
f.opened_path = file_handle->opened_path;
f.free_filename = file_handle->free_filename;
switch (file_handle->type) {
case ZEND_HANDLE_STREAM:

View File

@ -1585,7 +1585,6 @@ PHPAPI int php_stream_open_for_zend_ex(const char *filename, zend_file_handle *h
if (stream) {
handle->type = ZEND_HANDLE_STREAM;
handle->filename = (char*)filename;
handle->free_filename = 0;
handle->handle.stream.handle = stream;
handle->handle.stream.reader = (zend_stream_reader_t)_php_stream_read;
handle->handle.stream.fsizer = php_zend_stream_fsizer;

View File

@ -1313,7 +1313,6 @@ static int cli_main( int argc, char * argv[] )
highlight_file(SG(request_info).path_translated, &syntax_highlighter_ini);
} else if (source_highlight == 2) {
file_handle.filename = *p;
file_handle.free_filename = 0;
file_handle.opened_path = NULL;
ret = php_lint_script(&file_handle);
if (ret==SUCCESS) {
@ -1324,7 +1323,6 @@ static int cli_main( int argc, char * argv[] )
} else {
file_handle.filename = *p;
file_handle.free_filename = 0;
file_handle.opened_path = NULL;
php_execute_script(&file_handle);

View File

@ -294,10 +294,6 @@ zend_op_array *phpdbg_init_compile_file(zend_file_handle *file, int type) {
zend_string_release(file->opened_path);
file->opened_path = zend_string_init(filename, strlen(filename), 0);
} else {
if (file->free_filename) {
efree((char *) file->filename);
}
file->free_filename = 0;
file->filename = filename;
}
}