summaryrefslogtreecommitdiff
path: root/src/mem/packet.hh
diff options
context:
space:
mode:
authorAli Saidi <Ali.Saidi@ARM.com>2010-09-30 09:35:19 -0500
committerAli Saidi <Ali.Saidi@ARM.com>2010-09-30 09:35:19 -0500
commitaef4a9904e0324b2aba2ddc212768d5b0c72b566 (patch)
treeb52756d6c40904cbbd79940451faf1cab6597c18 /src/mem/packet.hh
parentc41e633e0efebb440083279c3841a2029ff50240 (diff)
downloadgem5-aef4a9904e0324b2aba2ddc212768d5b0c72b566.tar.xz
CPU/Cache: Fix some errors exposed by valgrind
Diffstat (limited to 'src/mem/packet.hh')
-rw-r--r--src/mem/packet.hh3
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());
}
/**