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

Unified Diff: runtime/vm/flags.cc

Issue 13483009: Fix http://dartbug.com/9137 : (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flags.cc
===================================================================
--- runtime/vm/flags.cc (revision 20937)
+++ runtime/vm/flags.cc (working copy)
@@ -102,9 +102,12 @@
const char* name,
bool default_value,
const char* comment) {
- ASSERT(Lookup(name) == NULL);
-
- Flag* flag = new Flag(name, comment, addr, Flag::kBoolean);
+ Flag* flag = Lookup(name);
+ if (flag != NULL) {
+ ASSERT(flag->IsUnrecognized());
+ return default_value;
siva 2013/04/05 07:14:28 nobody seems to use the return value from this fun
Ivan Posva 2013/04/22 12:59:27 It is used in flags.h: #define DEFINE_FLAG(type,
+ }
+ flag = new Flag(name, comment, addr, Flag::kBoolean);
flag->next_ = Flags::flags_;
Flags::flags_ = flag;
@@ -201,7 +204,7 @@
if (flag == NULL) {
// Collect unrecognized flags.
char* new_flag = new char[name_len + 1];
- strncpy(new_flag, name, name_len);
+ strncpy(new_flag, option, name_len);
new_flag[name_len] = '\0';
Flags::Register_bool(NULL, new_flag, true, NULL);
} else {
« 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