aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tools/lli/lli.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/lli/lli.cpp b/tools/lli/lli.cpp
index ba5a3a5dc7..ef9dddf750 100644
--- a/tools/lli/lli.cpp
+++ b/tools/lli/lli.cpp
@@ -52,6 +52,13 @@ int main(int argc, char** argv) {
if (ProfileMode) I.enableProfiling();
if (TraceMode) I.enableTracing();
+ // Ensure that there is at least one argument... the name of the program.
+ // This is only unavailable if the program was read from stdin, instead of a
+ // file.
+ //
+ if (InputArgv.empty())
+ InputArgv.push_back("from-stdin-prog");
+
// Start interpreter into the main function...
//
if (!I.callMainMethod(MainFunction, InputArgv) && !DebugMode) {