Skip to content

Commit

Permalink
Fix double calling plugin's OnWrite.
Browse files Browse the repository at this point in the history
  • Loading branch information
TricksterGuy authored Jun 6, 2022
1 parent 958724a commit 6511d52
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions liblc3/lc3_execute.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -803,7 +803,7 @@ void lc3_mem_write(lc3_state& state, unsigned short addr, short value, bool priv
/// TODO consider allowing writing to the PSR.
} else {
if (addr >= 0xFE00U && state.address_plugins.find(addr) != state.address_plugins.end())
state.address_plugins[addr]->OnWrite(state, addr, value);
return state.address_plugins[addr]->OnWrite(state, addr, value);
else if (!kernel_mode)
lc3_warning(state, LC3_RESERVED_MEM_WRITE, value, addr);
}
Expand All @@ -819,7 +819,7 @@ void lc3_mem_write(lc3_state& state, unsigned short addr, short value, bool priv
default:
// Hey does a plugin handle this address
if (addr >= 0xFE00U && state.address_plugins.find(addr) != state.address_plugins.end())
state.address_plugins[addr]->OnWrite(state, addr, value);
return state.address_plugins[addr]->OnWrite(state, addr, value);
else if (!kernel_mode)
lc3_warning(state, LC3_RESERVED_MEM_WRITE, value, addr);
}
Expand Down

0 comments on commit 6511d52

Please sign in to comment.