Skip to content

Commit

Permalink
fix(hooks): cast min and max to intptr_t
Browse files Browse the repository at this point in the history
  • Loading branch information
Curve committed May 20, 2024
1 parent a389bb2 commit 9335c27
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/hooks.hook.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -373,12 +373,15 @@ namespace lime
{
auto visitor = [&target]<typename T>(T *source)
{
if (std::numeric_limits<T>::max() < target)
static constexpr auto max = static_cast<std::intptr_t>(std::numeric_limits<T>::max());
static constexpr auto min = static_cast<std::intptr_t>(std::numeric_limits<T>::min());

if (max < target)
{
return false;
}

if (std::numeric_limits<T>::min() > target)
if (min > target)
{
return false;
}
Expand Down

0 comments on commit 9335c27

Please sign in to comment.