You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Incorrect validation of #[\Attribute]’s first parameter #13970
This turns out to be a regression, regressed in #8373.
In particular, we'll fail in zend_get_attribute_value that was called from validate_attribute to read the target.
That's because of this check:
// Preloading will attempt to resolve constants but objects can't be stored in shm
// Aborting here to store the const AST instead
if (CG(in_compilation)) {
returnFAILURE;
}
Note that we are in compilation, so the check will be true and we'll fail to resolve the enum.
If I change that check to if (CG(compiler_options) & ZEND_COMPILE_PRELOAD) { it works, but I guess that'll break in preloading... I'll check.
EDIT: of course it does
EDIT 2: checking both compiler_options and in_compilation, like so if (CG(in_compilation) && CG(compiler_options) & ZEND_COMPILE_PRELOAD) { makes all ext/opcache tests pass, now checking preloading...
EDIT 3: as expected, doesn't work, probably the check should happen at a difference place?
Activity
TimWolla commentedon Apr 15, 2024
Found while working on #11293.
ndossche commentedon Apr 15, 2024
This turns out to be a regression, regressed in #8373.
In particular, we'll fail in
zend_get_attribute_valuethat was called fromvalidate_attributeto read the target.That's because of this check:
php-src/Zend/zend_ast.c
Lines 807 to 811 in d407266
Note that we are in compilation, so the check will be true and we'll fail to resolve the enum.
If I change that check to
if (CG(compiler_options) & ZEND_COMPILE_PRELOAD) {it works, but I guess that'll break in preloading... I'll check.EDIT: of course it does
EDIT 2: checking both compiler_options and in_compilation, like so
if (CG(in_compilation) && CG(compiler_options) & ZEND_COMPILE_PRELOAD) {makes all ext/opcache tests pass, now checking preloading...EDIT 3: as expected, doesn't work, probably the check should happen at a difference place?