summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSteve Reinhardt <steve.reinhardt@amd.com>2016-02-06 17:21:20 -0800
committerSteve Reinhardt <steve.reinhardt@amd.com>2016-02-06 17:21:20 -0800
commit92b750d5efb56359e3c95ca6bc093ab4b6395aa1 (patch)
treea67177aeb7ecd3ac815c475692b27668d65c6d90 /src
parentf6b828d068b046df17b462a4d05af957c038a3a8 (diff)
downloadgem5-92b750d5efb56359e3c95ca6bc093ab4b6395aa1.tar.xz
syscall_emul: fix bug in aux vector initialization
Writing 16 bytes from an 8-byte source value is a bad idea. This doesn't appear to have broken anything, but showed up as spurious differences when tracediffing runs.
Diffstat (limited to 'src')
-rw-r--r--src/arch/x86/process.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/arch/x86/process.cc b/src/arch/x86/process.cc
index 8d1e1da96..82a23027d 100644
--- a/src/arch/x86/process.cc
+++ b/src/arch/x86/process.cc
@@ -983,8 +983,10 @@ X86LiveProcess::argsInit(int pageSize,
}
//Write out the terminating zeroed auxilliary vector
const uint64_t zero = 0;
- initVirtMem.writeBlob(auxv_array_base + 2 * intSize * auxv.size(),
- (uint8_t*)&zero, 2 * intSize);
+ initVirtMem.writeBlob(auxv_array_base + auxv.size() * 2 * intSize,
+ (uint8_t*)&zero, intSize);
+ initVirtMem.writeBlob(auxv_array_base + (auxv.size() * 2 + 1) * intSize,
+ (uint8_t*)&zero, intSize);
initVirtMem.writeString(aux_data_base, platform.c_str());