Skip to content
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

Always duplicate the method name in zend_get_call_trampoline_func(). #1798

Closed
wants to merge 1 commit into from

Conversation

LawnGnome
Copy link
Contributor

This fixes bug #71778 (which has more detail), and ensures that there isn't inconsistent behaviour in zend_get_call_trampoline_func() (and, probably more importantly from an actual use perspective, zend_std_get_method() by extension).

This doesn't apply to 5.x, so the PR is against 7.0 for easy merging up to master.

This fixes bug #71778 (which has more detail), and ensures that there
isn't inconsistent behaviour in zend_get_call_trampoline_func() (and,
probably more importantly, zend_std_get_method() by extension).
@nikic
Copy link
Member

nikic commented Mar 10, 2016

I don't understand what you are trying to fix here (having read the bug report). Your code snippet in the bug report will not free method_name, yes, but only because it is still used elsewhere.

@LawnGnome
Copy link
Contributor Author

@nikic How is func->function_name freed in the general case? We're seeing a leak as a result of this: is that because there's an underlying assumption that the zend_function * returned from zend_std_get_method() will then be invoked?

@nikic
Copy link
Member

nikic commented Mar 10, 2016

If you get a CALL_VIA_TRAMPOLINE function and you don't call it, you are responsible for freeing the function name and calling zend_free_trampoline.

@LawnGnome
Copy link
Contributor Author

@nikic Cheers; that would explain that, then. Is that just true of zend_std_get_method()? (I'll update the Wiki to document that, since I don't think it's written down anywhere — at least that I've found, anyway.)

@LawnGnome LawnGnome closed this Mar 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants