diff options
| author | Chris Lattner <sabre@nondot.org> | 2010-04-15 03:32:19 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2010-04-15 03:32:19 +0000 |
| commit | b1dd885e94c9a19fbb41f65ea3f5f1e867884036 (patch) | |
| tree | 11887b862da1f34d73a8353e7817f2d4aac5c023 | |
| parent | dbb6d1773175fd4945e1127745f66210021b7df3 (diff) | |
| download | external_llvm-b1dd885e94c9a19fbb41f65ea3f5f1e867884036.zip external_llvm-b1dd885e94c9a19fbb41f65ea3f5f1e867884036.tar.gz external_llvm-b1dd885e94c9a19fbb41f65ea3f5f1e867884036.tar.bz2 | |
fix a crash on "lli ex" or any other file whose name is exactly two
characters long.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101336 91177308-0d34-0410-b5e6-96231b3b80d8
| -rw-r--r-- | tools/lli/lli.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/lli/lli.cpp b/tools/lli/lli.cpp index 81c17cd..affe6bb 100644 --- a/tools/lli/lli.cpp +++ b/tools/lli/lli.cpp @@ -192,7 +192,8 @@ int main(int argc, char **argv, char * const *envp) { } else { // Otherwise, if there is a .bc suffix on the executable strip it off, it // might confuse the program. - if (InputFile.rfind(".bc") == InputFile.length() - 3) + if (InputFile.size() > 3 && + InputFile.rfind(".bc") == InputFile.length() - 3) InputFile.erase(InputFile.length() - 3); } |
