diff options
author | dim <dim@FreeBSD.org> | 2015-09-06 18:34:38 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2015-09-06 18:34:38 +0000 |
commit | 9fcebda97d0cb3d7a2235d2ad835c3a2679e7683 (patch) | |
tree | 461d3cf041290f4a99740d540bf0973d6084f98e /include/llvm/ADT/StringMap.h | |
parent | c5dd590220d0afe971d065bfe9324f549dd00968 (diff) | |
download | FreeBSD-src-9fcebda97d0cb3d7a2235d2ad835c3a2679e7683.zip FreeBSD-src-9fcebda97d0cb3d7a2235d2ad835c3a2679e7683.tar.gz |
Import llvm 3.7.0 release (r246257).
Diffstat (limited to 'include/llvm/ADT/StringMap.h')
-rw-r--r-- | include/llvm/ADT/StringMap.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/llvm/ADT/StringMap.h b/include/llvm/ADT/StringMap.h index 8721c73..9d03856 100644 --- a/include/llvm/ADT/StringMap.h +++ b/include/llvm/ADT/StringMap.h @@ -158,7 +158,8 @@ public: // Copy the string information. char *StrBuffer = const_cast<char*>(NewItem->getKeyData()); - memcpy(StrBuffer, Key.data(), KeyLength); + if (KeyLength > 0) + memcpy(StrBuffer, Key.data(), KeyLength); StrBuffer[KeyLength] = 0; // Null terminate for convenience of clients. return NewItem; } |