[llvm-commits] CVS: llvm/tools/llc/llc.cpp

John Criswell criswell at cs.uiuc.edu
Thu Aug 28 16:43:01 PDT 2003


Changes in directory llvm/tools/llc:

llc.cpp updated: 1.82 -> 1.83

---
Log message:

Added code to avoid checking for .bc when the filename is too short.


---
Diffs of the changes:

Index: llvm/tools/llc/llc.cpp
diff -u llvm/tools/llc/llc.cpp:1.82 llvm/tools/llc/llc.cpp:1.83
--- llvm/tools/llc/llc.cpp:1.82	Sun Aug 24 14:50:12 2003
+++ llvm/tools/llc/llc.cpp	Thu Aug 28 16:42:29 2003
@@ -44,7 +44,8 @@
   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;





More information about the llvm-commits mailing list