Skip to content

Commit 5c6521a

Browse files
committed
Drop special stream code handling, as this might been needed of the double free issue
1 parent cfeb6a4 commit 5c6521a

File tree

2 files changed

+3
-14
lines changed

2 files changed

+3
-14
lines changed

Zend/tests/throw_on_error/promote_warning_in_internal_function.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ try {
1313
--EXPECTF--
1414
object(Exception)#1 (7) {
1515
["message":protected]=>
16-
string(48) "Failed to open stream: No such file or directory"
16+
string(82) "file_get_contents(not_found.txt): Failed to open stream: No such file or directory"
1717
["string":"Exception":private]=>
1818
string(0) ""
1919
["code":protected]=>

main/streams/streams.c

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
#include <stddef.h>
3030
#include <fcntl.h>
3131
#include "php_streams_int.h"
32-
#include "Zend/zend_exceptions.h"
3332

3433
/* {{{ resource and registration code */
3534
/* Global wrapper hash, copied to FG(stream_wrappers) on registration of volatile wrapper */
@@ -211,18 +210,8 @@ void php_stream_display_wrapper_errors(php_stream_wrapper *wrapper, const char *
211210
msg = "no suitable wrapper could be found";
212211
}
213212

214-
/* To handle throw_on_error declare statement */
215-
zend_execute_data *ex = EG(current_execute_data);
216-
/* Find first non internal execute_data */
217-
while (ex && (!ex->func || !ZEND_USER_CODE(ex->func->type))) {
218-
ex = ex->prev_execute_data;
219-
}
220-
if ((ex->func->common.fn_flags & ZEND_ACC_THROW_WARNING) != 0) {
221-
zend_throw_exception_ex(zend_ce_exception, E_WARNING, "%s: %s", caption, msg);
222-
} else {
223-
php_strip_url_passwd(tmp);
224-
php_error_docref1(NULL, tmp, E_WARNING, "%s: %s", caption, msg);
225-
}
213+
php_strip_url_passwd(tmp);
214+
php_error_docref1(NULL, tmp, E_WARNING, "%s: %s", caption, msg);
226215
efree(tmp);
227216
if (free_msg) {
228217
efree(msg);

0 commit comments

Comments
 (0)