diff options
author | Ali Saidi <Ali.Saidi@ARM.com> | 2010-09-30 09:35:19 -0500 |
---|---|---|
committer | Ali Saidi <Ali.Saidi@ARM.com> | 2010-09-30 09:35:19 -0500 |
commit | aef4a9904e0324b2aba2ddc212768d5b0c72b566 (patch) | |
tree | b52756d6c40904cbbd79940451faf1cab6597c18 /src/mem/packet.hh | |
parent | c41e633e0efebb440083279c3841a2029ff50240 (diff) | |
download | gem5-aef4a9904e0324b2aba2ddc212768d5b0c72b566.tar.xz |
CPU/Cache: Fix some errors exposed by valgrind
Diffstat (limited to 'src/mem/packet.hh')
-rw-r--r-- | src/mem/packet.hh | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mem/packet.hh b/src/mem/packet.hh index 48b80879e..41edef8a7 100644 --- a/src/mem/packet.hh +++ b/src/mem/packet.hh @@ -705,7 +705,8 @@ class Packet : public FastAlloc, public Printable void setData(uint8_t *p) { - std::memcpy(getPtr<uint8_t>(), p, getSize()); + if (p != getPtr<uint8_t>()) + std::memcpy(getPtr<uint8_t>(), p, getSize()); } /** |