Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
dvander foxes
  • Loading branch information
Headline committed Dec 20, 2018
1 parent 5374982 commit 96695e2
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions core/sourcehook/sh_memory.h
Expand Up @@ -248,7 +248,7 @@ namespace SourceHook
*/
namespace
{
bool ModuleInMemory(char *addr, size_t len)
static inline bool ModuleInMemory(char *addr, size_t len)
{
#if SH_SYS == SH_SYS_LINUX
// On linux, first check /proc/self/maps
Expand Down Expand Up @@ -322,10 +322,8 @@ namespace SourceHook
prevHandler = signal(SIGSEGV, BadReadHandler);

volatile const char *p = reinterpret_cast<const char*>(addr);
char dummy;

for (size_t i = 0; i < len; i++)
dummy = p[i];
p[i];

g_BadReadCalled = false;

Expand All @@ -346,10 +344,8 @@ namespace SourceHook
return false;

volatile const char *p = reinterpret_cast<const char *>(addr);
char dummy;

for (size_t i = 0; i < len; i++)
dummy = p[i];
p[i];

g_BadReadCalled = false;

Expand Down

0 comments on commit 96695e2

Please sign in to comment.