Skip to content

Commit

Permalink
Avoid hook called with unsupported arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
yujincheng08 committed Aug 9, 2024
1 parent 897c70b commit 56a9cf7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lsplant/src/main/jni/include/utils/hook_helper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,9 @@ struct HookHandler {
hook(dlsym<Sym>(), reinterpret_cast<void *>(hooker.replace_))));
}

template <typename... T>
[[gnu::always_inline]] bool hook(T &...args) const {
return (hook(args) || ...);
template <typename T1, typename T2, typename... U>
[[gnu::always_inline]] bool hook(T1 &arg1, T2 &arg2, U &...args) const {
return ((hook(arg1) || hook(arg2)) || ... || hook(args));
}

private:
Expand Down

0 comments on commit 56a9cf7

Please sign in to comment.