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

Issue 452093002: Fix command line parsing. (Closed)

Created:
6 years, 4 months ago by vogelheim
Modified:
6 years, 4 months ago
CC:
v8-dev
Project:
v8
Visibility:
Public.

Description

Fix command line parsing. For --min-parse-length --cache=code, SetFlagsFromCommandLine sees an argv like this: [".../blabla/d8", "min-parse-length", NULL] It then calls strtol(NULL, ...), which strtol dislikes. It turns out that: - V8::Shell::SetOptions will pick out its own arguments, and replace them in argv with NULL values. - v8::internal::SetFlagsFromCommandLine is mostly aware of this. - However, when a general v8 argument w/ parameter is followed by a d8 argument then this happens: - SetOptions parses its arguments and replaces it will NULL. - SetFlagsFromCommandLine tries to parse and arg w/ parameter, but finds a NULL in its place. - The parsing function for the argument receives a NULL pointer and doesn't like it. Easy to fix by checking for NULL after argv. Probably little real world effect, since this only affects v8 when used through d8. R=hpayer@chromium.org BUG=401432

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+2 lines, -1 line) Patch
M src/flags.cc View 1 chunk +2 lines, -1 line 0 comments Download

Messages

Total messages: 3 (0 generated)
vogelheim
6 years, 4 months ago (2014-08-08 13:19:28 UTC) #1
Hannes Payer (out of office)
lgtm
6 years, 4 months ago (2014-08-08 13:46:43 UTC) #2
vogelheim
6 years, 4 months ago (2014-08-11 14:03:22 UTC) #3
Committed as r23005.

(I inadvertently committed w/ 'git svn dcommit' rather than 'git cl dcommit',
hence no automated message.)

Powered by Google App Engine
This is Rietveld 408576698