Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(139)

Side by Side Diff: runtime/bin/main.cc

Issue 293983008: Fix crash when no package root argument is specified. (Issue 18935). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include <stdlib.h> 5 #include <stdlib.h>
6 #include <string.h> 6 #include <string.h>
7 #include <stdio.h> 7 #include <stdio.h>
8 8
9 #include "include/dart_api.h" 9 #include "include/dart_api.h"
10 #include "include/dart_debugger_api.h" 10 #include "include/dart_debugger_api.h"
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
384 while (i < argc) { 384 while (i < argc) {
385 if (ProcessMainOptions(argv[i])) { 385 if (ProcessMainOptions(argv[i])) {
386 i++; 386 i++;
387 } else { 387 } else {
388 // Check if this flag is a potentially valid VM flag. 388 // Check if this flag is a potentially valid VM flag.
389 const char* kChecked = "-c"; 389 const char* kChecked = "-c";
390 const char* kPackageRoot = "-p"; 390 const char* kPackageRoot = "-p";
391 if (strncmp(argv[i], kPackageRoot, strlen(kPackageRoot)) == 0) { 391 if (strncmp(argv[i], kPackageRoot, strlen(kPackageRoot)) == 0) {
392 if (!ProcessPackageRootOption(argv[i] + strlen(kPackageRoot))) { 392 if (!ProcessPackageRootOption(argv[i] + strlen(kPackageRoot))) {
393 i++; 393 i++;
394 if (!ProcessPackageRootOption(argv[i])) { 394 if ((argv[i] == NULL) || !ProcessPackageRootOption(argv[i])) {
395 Log::PrintErr("Invalid option specification : '%s'\n", argv[i - 1]); 395 Log::PrintErr("Invalid option specification : '%s'\n", argv[i - 1]);
396 i++; 396 i++;
397 break; 397 break;
398 } 398 }
399 } 399 }
400 } else if (strncmp(argv[i], kChecked, strlen(kChecked)) == 0) { 400 } else if (strncmp(argv[i], kChecked, strlen(kChecked)) == 0) {
401 vm_options->AddArgument("--checked"); 401 vm_options->AddArgument("--checked");
402 } else if (!IsValidFlag(argv[i], kPrefix, kPrefixLen)) { 402 } else if (!IsValidFlag(argv[i], kPrefix, kPrefixLen)) {
403 break; 403 break;
404 } 404 }
(...skipping 731 matching lines...) Expand 10 before | Expand all | Expand 10 after
1136 exit(Process::GlobalExitCode()); 1136 exit(Process::GlobalExitCode());
1137 } 1137 }
1138 1138
1139 } // namespace bin 1139 } // namespace bin
1140 } // namespace dart 1140 } // namespace dart
1141 1141
1142 int main(int argc, char** argv) { 1142 int main(int argc, char** argv) {
1143 dart::bin::main(argc, argv); 1143 dart::bin::main(argc, argv);
1144 UNREACHABLE(); 1144 UNREACHABLE();
1145 } 1145 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698