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

Fix removal of the directly accessed hook after binding in DDTrace\remove_hook #2449

Merged
merged 1 commit into from
Jan 4, 2024

Conversation

bwoebi
Copy link
Collaborator

@bwoebi bwoebi commented Jan 3, 2024

Description

Taking the tests from #2422, but actually remove the hooks inside DDTrace\remove_hook instead.

And for some reason I was left-shifting ce_addresses, causing more collisions, instead of less. Fixed to right-shift.

Reviewer checklist

  • Test coverage seems ok.
  • Appropriate labels assigned.

…move_hook

Signed-off-by: Bob Weinand <bob.weinand@datadoghq.com>
@bwoebi bwoebi added this to the 0.97.0 milestone Jan 3, 2024
@bwoebi bwoebi requested a review from a team as a code owner January 3, 2024 17:09
@github-actions github-actions bot removed this from the 0.97.0 milestone Jan 3, 2024

zend_class_entry *ce = NULL;
zend_string *function_name = hooks->resolved->common.function_name;
zend_function *resolved = zai_hook_lookup_function(zai_str_from_zstr(lc_classname), zai_str_from_zstr(function_name), &ce);
if (!ce || !resolved) {
zai_hook_add_exclusion(hooks, index, lc_classname);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we moving this instruction here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it's resolved, the hook will be already there and doesn't need a named exclusion, but can just be removed.

@bwoebi bwoebi merged commit 3bd3bc6 into master Jan 4, 2024
604 of 612 checks passed
@bwoebi bwoebi deleted the bob/fix-remove-hook branch January 4, 2024 16:53
@github-actions github-actions bot added this to the 0.97.0 milestone Jan 4, 2024
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.

2 participants