summaryrefslogtreecommitdiff
path: root/tools/lli
diff options
context:
space:
mode:
Diffstat (limited to 'tools/lli')
-rw-r--r--tools/lli/lli.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/lli/lli.cpp b/tools/lli/lli.cpp
index 81c17cd8fc..affe6bb653 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);
}