From c732ab400af92c54eee47c487a56009f1d79dd5d Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Tue, 16 Mar 2021 20:31:36 +0300 Subject: Change Zend Stream API to use zend_string* instead of char*. This allows to eliminate re-calculation of string lenght and hash value. See the detailed list of changes in UPGRADING.INTERNALS. --- sapi/phpdbg/phpdbg_prompt.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'sapi/phpdbg/phpdbg_prompt.c') diff --git a/sapi/phpdbg/phpdbg_prompt.c b/sapi/phpdbg/phpdbg_prompt.c index 13026978bf..acdae17ce3 100644 --- a/sapi/phpdbg/phpdbg_prompt.c +++ b/sapi/phpdbg/phpdbg_prompt.c @@ -566,7 +566,8 @@ int phpdbg_compile(void) /* {{{ */ return FAILURE; } - if (php_stream_open_for_zend_ex(PHPDBG_G(exec), &fh, USE_PATH|STREAM_OPEN_FOR_INCLUDE) == SUCCESS && zend_stream_fixup(&fh, &buf, &len) == SUCCESS) { + zend_stream_init_filename(&fh, PHPDBG_G(exec)); + if (php_stream_open_for_zend_ex(&fh, USE_PATH|STREAM_OPEN_FOR_INCLUDE) == SUCCESS && zend_stream_fixup(&fh, &buf, &len) == SUCCESS) { CG(skip_shebang) = 1; PHPDBG_G(ops) = zend_compile_file(&fh, ZEND_INCLUDE); zend_destroy_file_handle(&fh); @@ -581,7 +582,7 @@ int phpdbg_compile(void) /* {{{ */ } else { phpdbg_error("compile", "type=\"openfailure\" context=\"%s\"", "Could not open file %s", PHPDBG_G(exec)); } - + zend_destroy_file_handle(&fh); return FAILURE; } /* }}} */ -- cgit v1.2.1