about summary refs log tree commit diff stats
path: root/015immediate_addressing.cc
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2020-02-05 10:33:28 -0800
committerKartik Agaram <vc@akkartik.com>2020-02-05 14:57:52 -0800
commit9ee351f37fbf78aa408f60c0d2c7ec49e625f109 (patch)
treeed55ef4c9cfcbedefda64767164855b576748c75 /015immediate_addressing.cc
parentb9d666eff51659a62dab7b746e5ae40431127e9b (diff)
downloadmu-9ee351f37fbf78aa408f60c0d2c7ec49e625f109.tar.gz
5983 - fix an emulator bounds-check bug
It was possible for an instruction to write out of bounds of the memory
data structure. Most of the time this worked fine. However if the block
ever got resized and moved the out-of-bounds bytes no longer went along.
Diffstat (limited to '015immediate_addressing.cc')
-rw-r--r--015immediate_addressing.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/015immediate_addressing.cc b/015immediate_addressing.cc
index c264d5d3..a2923b7a 100644
--- a/015immediate_addressing.cc
+++ b/015immediate_addressing.cc
@@ -1235,7 +1235,7 @@ case 0xc7: {  // copy imm32 to r32
   int32_t* dest = effective_address(modrm);
   const int32_t src = next32();
   trace(Callstack_depth+1, "run") << "imm32 is 0x" << HEXWORD << src << end();
-  *dest = src;
+  *dest = src;  // Write multiple elements of vector<uint8_t> at once. Assumes sizeof(int) == 4 on the host as well.
   break;
 }