Skip to content

Commit 3b7f972

Browse files
committed
Fix x86 warnings
- Fixes potential overflows when type-casting - Fixes a signed/unsigned mismatch in m_BuiltinCount comparison
1 parent f26a614 commit 3b7f972

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

YYToolkit/source/YYTK/Module Interface/Interface.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1390,7 +1390,7 @@ namespace YYTK
13901390
}
13911391

13921392
// Loop all builtin entries
1393-
for (size_t i = 0; i < *m_BuiltinCount; i++)
1393+
for (int i = 0; i < *m_BuiltinCount; i++)
13941394
{
13951395
// If we have a match with the name, we cache the index and return
13961396
if (!strcmp(Name.data(), m_BuiltinArray[i].m_Name))

YYToolkit/source/YYTK/Module Internals/GameMaker/Generic/Generic-RunnerInterfaceNew.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ namespace YYTK
254254
auto instructions_in_the_current_page = GmpDisassemble(
255255
page_base,
256256
PAGE_SIZE,
257-
UINT64_MAX
257+
SIZE_MAX
258258
);
259259

260260
std::vector<std::pair<size_t, ZydisDisassembledInstruction>> lea_mov_pairs = {};
@@ -344,7 +344,7 @@ namespace YYTK
344344
if (mov_instruction.operands[0].mem.base != ZYDIS_REGISTER_RBP && mov_instruction.operands[0].mem.base != ZYDIS_REGISTER_RSP)
345345
continue;
346346

347-
valid_lea_mov_pairs_addresses.push_back(pair.second.runtime_address);
347+
valid_lea_mov_pairs_addresses.push_back(static_cast<size_t>(pair.second.runtime_address));
348348
}
349349

350350
// Filter valid_lea_mov_pairs_addresses by checking the length of function chains.
@@ -397,5 +397,7 @@ namespace YYTK
397397

398398
return AURIE_SUCCESS;
399399
}
400+
401+
return AURIE_OBJECT_NOT_FOUND;
400402
}
401403
}

0 commit comments

Comments
 (0)