Skip to content

Commit

Permalink
Fix narrowing issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
sa666666 committed Aug 7, 2024
1 parent f397dd0 commit 8f1f94e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/emucore/CortexM0.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ namespace {
inline uInt32 READ32(const uInt8* data, uInt32 addr) {
return (reinterpret_cast<const uInt32*>(data))[addr >> 2];
}
inline uInt16 READ16(const uInt8* data, uInt16 addr) {
inline uInt16 READ16(const uInt8* data, uInt32 addr) {
return (reinterpret_cast<const uInt16*>(data))[addr >> 1];
}

Expand Down Expand Up @@ -690,7 +690,7 @@ void CortexM0::recompileCodeRegions()
if (!std::holds_alternative<MemoryRegionAccessCode>(region.access))
continue;

for (size_t i = 0; i < region.size; i += 2)
for (uInt32 i = 0; i < region.size; i += 2)
std::get<1>(region.access).ops[i >> 1] =
decodeInstructionWord(READ16(std::get<1>(region.access).backingStore, i));
}
Expand Down

0 comments on commit 8f1f94e

Please sign in to comment.