Skip to content

Commit

Permalink
fix a crash on "lli ex" or any other file whose name is exactly two
Browse files Browse the repository at this point in the history
characters long.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101336 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
lattner committed Apr 15, 2010
1 parent 0dbdca5 commit 6484dd4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tools/lli/lli.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 6484dd4

Please sign in to comment.