diff options
author | Brian Carlstrom <bdc@google.com> | 2014-02-25 23:08:33 -0800 |
---|---|---|
committer | Brian Carlstrom <bdc@google.com> | 2014-02-25 23:35:49 -0800 |
commit | 686107ea2f123edf8fbba2df5081a5f0b6de4d13 (patch) | |
tree | 66cd50556da0d17c43e90eaf752aa642cde72348 /dalvikvm | |
parent | ef2cc5a9c6e508a3e8b24d04ca35f7422f27e112 (diff) | |
download | art-686107ea2f123edf8fbba2df5081a5f0b6de4d13.zip art-686107ea2f123edf8fbba2df5081a5f0b6de4d13.tar.gz art-686107ea2f123edf8fbba2df5081a5f0b6de4d13.tar.bz2 |
Fix dalvikvm -help
Bug: https://code.google.com/p/android/issues/detail?id=62149
Change-Id: I8ab11cc7c171dc4b7eee1d33aa1624aae832a393
Diffstat (limited to 'dalvikvm')
-rw-r--r-- | dalvikvm/dalvikvm.cc | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/dalvikvm/dalvikvm.cc b/dalvikvm/dalvikvm.cc index ea8461f..3486c1d 100644 --- a/dalvikvm/dalvikvm.cc +++ b/dalvikvm/dalvikvm.cc @@ -152,15 +152,7 @@ static int dalvikvm(int argc, char** argv) { return EXIT_FAILURE; } - // Make sure they provided a class name. - if (arg_idx == argc) { - fprintf(stderr, "Class name required\n"); - return EXIT_FAILURE; - } - - // insert additional internal options here - - if (curr_opt >= option_count) { + if (curr_opt > option_count) { fprintf(stderr, "curr_opt(%d) >= option_count(%d)\n", curr_opt, option_count); abort(); return EXIT_FAILURE; @@ -187,6 +179,14 @@ static int dalvikvm(int argc, char** argv) { return EXIT_FAILURE; } + // Make sure they provided a class name. We do this after + // JNI_CreateJavaVM so that things like "-help" have the opportunity + // to emit a usage statement. + if (arg_idx == argc) { + fprintf(stderr, "Class name required\n"); + return EXIT_FAILURE; + } + int rc = InvokeMain(env, &argv[arg_idx]); #if defined(NDEBUG) |