From 20e856b2a58d12231aa42d5d13888b15ac03e5a4 Mon Sep 17 00:00:00 2001 From: rdivacky Date: Fri, 2 Apr 2010 08:54:30 +0000 Subject: Update LLVM to r100181. --- lib/MC/MCSection.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib/MC/MCSection.cpp') diff --git a/lib/MC/MCSection.cpp b/lib/MC/MCSection.cpp index 24c89ef..f6e9636 100644 --- a/lib/MC/MCSection.cpp +++ b/lib/MC/MCSection.cpp @@ -26,7 +26,11 @@ MCSection::~MCSection() { MCSectionCOFF *MCSectionCOFF:: Create(StringRef Name, bool IsDirective, SectionKind K, MCContext &Ctx) { - return new (Ctx) MCSectionCOFF(Name, IsDirective, K); + char *NameCopy = static_cast( + Ctx.Allocate(Name.size(), /*Alignment=*/1)); + memcpy(NameCopy, Name.data(), Name.size()); + return new (Ctx) MCSectionCOFF(StringRef(NameCopy, Name.size()), + IsDirective, K); } void MCSectionCOFF::PrintSwitchToSection(const MCAsmInfo &MAI, -- cgit v1.1