Skip to content

Commit 96695e2

Browse files
committed
dvander foxes
1 parent 5374982 commit 96695e2

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

core/sourcehook/sh_memory.h

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ namespace SourceHook
248248
*/
249249
namespace
250250
{
251-
bool ModuleInMemory(char *addr, size_t len)
251+
static inline bool ModuleInMemory(char *addr, size_t len)
252252
{
253253
#if SH_SYS == SH_SYS_LINUX
254254
// On linux, first check /proc/self/maps
@@ -322,10 +322,8 @@ namespace SourceHook
322322
prevHandler = signal(SIGSEGV, BadReadHandler);
323323

324324
volatile const char *p = reinterpret_cast<const char*>(addr);
325-
char dummy;
326-
327325
for (size_t i = 0; i < len; i++)
328-
dummy = p[i];
326+
p[i];
329327

330328
g_BadReadCalled = false;
331329

@@ -346,10 +344,8 @@ namespace SourceHook
346344
return false;
347345

348346
volatile const char *p = reinterpret_cast<const char *>(addr);
349-
char dummy;
350-
351347
for (size_t i = 0; i < len; i++)
352-
dummy = p[i];
348+
p[i];
353349

354350
g_BadReadCalled = false;
355351

0 commit comments

Comments
 (0)