Index: llvm/trunk/lib/Support/StringSaver.cpp =================================================================== --- llvm/trunk/lib/Support/StringSaver.cpp +++ llvm/trunk/lib/Support/StringSaver.cpp @@ -13,7 +13,8 @@ StringRef StringSaver::save(StringRef S) { char *P = Alloc.Allocate(S.size() + 1); - memcpy(P, S.data(), S.size()); + if (!S.empty()) + memcpy(P, S.data(), S.size()); P[S.size()] = '\0'; return StringRef(P, S.size()); }