From: Nikita Popov Date: Tue, 3 Nov 2020 15:24:54 +0000 (+0100) Subject: Report parse errors during preloading X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b009573f4e2f085208f583faffc050746d5d363e;p=php Report parse errors during preloading --- diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c index 5f1d80c083..4d2fbb7130 100644 --- a/ext/opcache/ZendAccelerator.c +++ b/ext/opcache/ZendAccelerator.c @@ -4480,6 +4480,10 @@ static int accel_preload(const char *config, zend_bool in_child) destroy_op_array(op_array); efree_size(op_array, sizeof(zend_op_array)); } else { + if (EG(exception)) { + zend_exception_error(EG(exception), E_ERROR); + } + CG(unclean_shutdown) = 1; ret = FAILURE; } diff --git a/ext/opcache/tests/preload_parse_error.inc b/ext/opcache/tests/preload_parse_error.inc new file mode 100644 index 0000000000..08b9d7799c --- /dev/null +++ b/ext/opcache/tests/preload_parse_error.inc @@ -0,0 +1,2 @@ + +--FILE-- +OK +--EXPECTF-- +Parse error: syntax error, unexpected identifier "error" in %s on line %d