com php-src: Set filename & lineno information for preload inheritance error: ext/opcache/ZendAccelerator.c ext/opcache/tests/preload _006.phpt
| From: | Nikita Popov | Date: | Fri, 15 Feb 2019 16:03:57 +0000 |
| Subject: | com php-src: Set filename & lineno information for preload inheritance error: ext/opcache/ZendAccelerator.c ext/opcache/tests/preload _006.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-104669@lists.php.net to get a copy of this message | ||
Commit: 1b31b45f6f731fda7586cbcfd710477f21d85b8c
Author: Nikita Popov <nikita.ppv@gmail.com> Fri, 15 Feb 2019 17:03:57 +0100
Parents: 92fae00ee0674c7fef830b01aa474d8bc684bf74
Branches: PHP-7.4 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=1b31b45f6f731fda7586cbcfd710477f21d85b8c
Log:
Set filename & lineno information for preload inheritance error
Changed paths:
M ext/opcache/ZendAccelerator.c
M ext/opcache/tests/preload_006.phpt
Diff:
diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator..c
index f9e67ef..3214477 100644
--- a/ext/opcache/ZendAccelerator.c
+++ b/ext/opcache/ZendAccelerator.c
@@ -3335,7 +3335,14 @@ static void preload_link(void)
zv = zend_hash_set_bucket_key(EG(class_table), (Bucket*)zv, key);
zend_string_release(key);
if (EXPECTED(zv)) {
+ /* Set filename & lineno information for inheritance errors */
+ CG(in_compilation) = 1;
+ CG(compiled_filename) = ce->info.user.filename;
+ CG(zend_lineno) = ce->info.user.line_start;
zend_do_link_class(ce, parent);
+ CG(in_compilation) = 0;
+ CG(compiled_filename) = NULL;
+
changed = 1;
}
}
diff --git a/ext/opcache/tests/preload_006.phpt b/ext/opcache/tests/preload_006.phpt
index 925b9a6..bbecfcf 100644
--- a/ext/opcache/tests/preload_006.phpt
+++ b/ext/opcache/tests/preload_006.phpt
@@ -11,5 +11,5 @@ opcache.preload={PWD}/preload_inheritance_error_ind.inc
<?php
echo "Foobar\n";
?>
---EXPECT--
-Fatal error: Declaration of B::foo($bar) must be compatible with A::foo() in Unknown on line 0
+--EXPECTF--
+Fatal error: Declaration of B::foo($bar) must be compatible with A::foo() in
%spreload_inheritance_error.inc on line 7