Skip to content

Commit

Permalink
Add nullptr check and log. Hit this with icache enabled when trying
Browse files Browse the repository at this point in the history
  • Loading branch information
Remy van Elst committed Apr 30, 2024
1 parent 549f716 commit b9a7de4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/AlphaCPU.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -494,8 +494,12 @@ inline int CAlphaCPU::get_icache(u64 address, u32 *data) {
return result;
}

memcpy(state.icache[state.next_icache].data, cSystem->PtrToMem(p_a),
char* addr = cSystem->PtrToMem(p_a);
if(addr)
memcpy(state.icache[state.next_icache].data, addr,
ICACHE_LINE_SIZE * 4);
else
printf("PtrToMem(p_a) == nullptr! Address: %lu.\n", p_a);

state.icache[state.next_icache].valid = true;
state.icache[state.next_icache].asn = state.asn;
Expand Down

0 comments on commit b9a7de4

Please sign in to comment.