mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Fix include_once in phpdbg
This commit is contained in:
parent
455eabcd2c
commit
d33e71b358
1 changed files with 6 additions and 4 deletions
|
@ -233,6 +233,7 @@ void phpdbg_list_function_byname(const char *str, size_t len) /* {{{ */
|
||||||
efree(func_name);
|
efree(func_name);
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
|
/* Note: do not free the original file handler, let original compile_file() or caller do that. Caller may rely on its value to check success */
|
||||||
zend_op_array *phpdbg_compile_file(zend_file_handle *file, int type) {
|
zend_op_array *phpdbg_compile_file(zend_file_handle *file, int type) {
|
||||||
phpdbg_file_source data, *dataptr;
|
phpdbg_file_source data, *dataptr;
|
||||||
zend_file_handle fake;
|
zend_file_handle fake;
|
||||||
|
@ -243,8 +244,7 @@ zend_op_array *phpdbg_compile_file(zend_file_handle *file, int type) {
|
||||||
char resolved_path_buf[MAXPATHLEN];
|
char resolved_path_buf[MAXPATHLEN];
|
||||||
|
|
||||||
if (zend_stream_fixup(file, &bufptr, &data.len) == FAILURE) {
|
if (zend_stream_fixup(file, &bufptr, &data.len) == FAILURE) {
|
||||||
zend_file_handle_dtor(file);
|
return PHPDBG_G(compile_file)(file, type);
|
||||||
return NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
data.buf = emalloc(data.len + ZEND_MMAP_AHEAD + 1);
|
data.buf = emalloc(data.len + ZEND_MMAP_AHEAD + 1);
|
||||||
|
@ -281,6 +281,10 @@ zend_op_array *phpdbg_compile_file(zend_file_handle *file, int type) {
|
||||||
if (ret == NULL) {
|
if (ret == NULL) {
|
||||||
efree(data.buf);
|
efree(data.buf);
|
||||||
efree(dataptr);
|
efree(dataptr);
|
||||||
|
|
||||||
|
fake.opened_path = NULL;
|
||||||
|
zend_file_handle_dtor(&fake);
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -290,8 +294,6 @@ zend_op_array *phpdbg_compile_file(zend_file_handle *file, int type) {
|
||||||
|
|
||||||
fake.opened_path = NULL;
|
fake.opened_path = NULL;
|
||||||
zend_file_handle_dtor(&fake);
|
zend_file_handle_dtor(&fake);
|
||||||
zend_file_handle_dtor(file);
|
|
||||||
file->type = -1;
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue