-
Notifications
You must be signed in to change notification settings - Fork 7.8k
Fix lineno for all constant expressions #8855
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
Conversation
7eb0ac0
to
a68e49f
Compare
I don't like the way this is fixed. In particular it overrides call site information. Would it be possible to install a fake (execute_data) frame when evaluated instead? I.e. line 8 calls line 11? The fake function name for that frame could be something like "constant X" (or "constant someclass::X"). This also applies to #8124 (which initially looked good to me, but I overlooked the include). |
@bwoebi You're right, that would be more desirable.
That would certainly be good, although we have to go through all the cases that use |
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.
I also don't like a special case covered by EG(filename_override)/EG(lineno_override), but I think creating a fake call frame is going to be too complex for this problem. So it's better to keep this simple solution.
I had another look. @bwoebi I added a frame to the trace so it doesn't get lost. Let me know if you think this is acceptable now. If now I'll at least fix the lineno on |
@bwoebi Have you ever had time to review this? I'm happy closing this if either of you object. |
@iluuu1994 I don't object to it :-) |
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.
Yes, please merge it :-)
Closes GH-8821
I'm not sure what the performance implications of the setjmp are for each iteration of
zend_ast_evaluate
, but ifzend_ast_evaluate
bails we could end up with a freed string infilename_override
which would be bad.