-
Notifications
You must be signed in to change notification settings - Fork 7.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix infinite recursion on deprecated attribute evaluation #17712
base: PHP-8.4
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fix makes sense to me and is consistent with the existing MARK_CONSTANT_VISITED()
mechanism that is used for self-referencing constants.
All tests (no opcache, opcache, JIT) pass for me locally with ASAN, so I can't comment on the CI failures.
The failures are caused by modification of shm... I'll need to switch some things around but was too tired yesterday. |
1780131
to
0d31ece
Compare
I think it should be fine now. We only need to add recursion protection when the constant value is a constant AST. If it isn't, we won't attempt to evaluate it again. Recursive errors through |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still LGTM, no strong opinion on my suggestion. You're the expert.
Fixes GH-17711
Discovered in GH-16952, where the issue is more obvious to reproduce. Optimally, this could have been moved into
zend_deprecated_class_constant()
to avoid duplication, but that's not possible because it marks thec
asconst
.