summaryrefslogtreecommitdiffstats
path: root/tools/llc
diff options
context:
space:
mode:
authorJohn Criswell <criswell@uiuc.edu>2003-08-28 21:42:29 +0000
committerJohn Criswell <criswell@uiuc.edu>2003-08-28 21:42:29 +0000
commitb5d09bf4cc7769ccbd86a96fb8ea92e3c6e3bbc7 (patch)
treecca48759ff6d0b68a9a0b3f5dcf2625e6e5979a2 /tools/llc
parentad0bf0fc0cead2c714d6a0e164d3bdb2864eb8e1 (diff)
downloadexternal_llvm-b5d09bf4cc7769ccbd86a96fb8ea92e3c6e3bbc7.zip
external_llvm-b5d09bf4cc7769ccbd86a96fb8ea92e3c6e3bbc7.tar.gz
external_llvm-b5d09bf4cc7769ccbd86a96fb8ea92e3c6e3bbc7.tar.bz2
Added code to avoid checking for .bc when the filename is too short.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8190 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llc')
-rw-r--r--tools/llc/llc.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/llc/llc.cpp b/tools/llc/llc.cpp
index 9673343..6a769d8 100644
--- a/tools/llc/llc.cpp
+++ b/tools/llc/llc.cpp
@@ -44,7 +44,8 @@ GetFileNameRoot(const std::string &InputFilename)
std::string IFN = InputFilename;
std::string outputFilename;
int Len = IFN.length();
- if (IFN[Len-3] == '.' && IFN[Len-2] == 'b' && IFN[Len-1] == 'c') {
+ if ((Len > 2) &&
+ IFN[Len-3] == '.' && IFN[Len-2] == 'b' && IFN[Len-1] == 'c') {
outputFilename = std::string(IFN.begin(), IFN.end()-3); // s/.bc/.s/
} else {
outputFilename = IFN;