aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2009-11-25 18:26:09 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2009-11-25 18:26:09 +0000
commit1c3451fc99feb68dc401049568788547a0b7844d (patch)
treedc975e6f111ad2561043963fb7ba8b01982bb330 /lib/CodeGen
parent65dbc909f5377947026a41f29420bb8112bdf611 (diff)
downloadexternal_llvm-1c3451fc99feb68dc401049568788547a0b7844d.zip
external_llvm-1c3451fc99feb68dc401049568788547a0b7844d.tar.gz
external_llvm-1c3451fc99feb68dc401049568788547a0b7844d.tar.bz2
Avoid some possibly unsafe uses of StringRef::data().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89873 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfDebug.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index ab9d96f..9dad574 100644
--- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -1010,7 +1010,7 @@ DIE *DwarfDebug::createGlobalVariableDIE(CompileUnit *DW_Unit,
// Objective-C symbol names and symbol whose name is replaced using GCC's
// __asm__ attribute.
if (LinkageName[0] == 1)
- LinkageName = LinkageName.data() + 1;
+ LinkageName = LinkageName.substr(1);
addString(GVDie, dwarf::DW_AT_MIPS_linkage_name, dwarf::DW_FORM_string,
LinkageName);
}
@@ -1097,7 +1097,7 @@ DIE *DwarfDebug::createSubprogramDIE(CompileUnit *DW_Unit,
// Objective-C symbol names and symbol whose name is replaced using GCC's
// __asm__ attribute.
if (LinkageName[0] == 1)
- LinkageName = LinkageName.data() + 1;
+ LinkageName = LinkageName.substr(1);
addString(SPDie, dwarf::DW_AT_MIPS_linkage_name, dwarf::DW_FORM_string,
LinkageName);
}
@@ -2899,7 +2899,7 @@ void DwarfDebug::emitDebugInlineInfo() {
// Objective-C symbol names and symbol whose name is replaced using GCC's
// __asm__ attribute.
if (LName[0] == 1)
- LName = LName.data() + 1;
+ LName = LName.substr(1);
// Asm->EmitString(LName);
EmitSectionOffset("string", "section_str",
StringPool.idFor(LName), false, true);