Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit fb7bee2

Browse filesBrowse files
bnoordhuisruyadorno
authored andcommitted
src: fix c++ exception on bad command line arg
Replace stoull() with strtoull(). The former throws an exception when the input is malformed, the latter doesn't. Fixes: #46223 PR-URL: #46290 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 940484b commit fb7bee2
Copy full SHA for fb7bee2

File tree

Expand file treeCollapse file tree

2 files changed

+4
-3
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+4
-3
lines changed
Open diff view settings
Collapse file

‎src/node_options-inl.h‎

Copy file name to clipboardExpand all lines: src/node_options-inl.h
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,8 @@ void OptionsParser<Options>::Parse(
444444
*Lookup<int64_t>(info.field, options) = std::atoll(value.c_str());
445445
break;
446446
case kUInteger:
447-
*Lookup<uint64_t>(info.field, options) = std::stoull(value);
447+
*Lookup<uint64_t>(info.field, options) =
448+
std::strtoull(value.c_str(), nullptr, 10);
448449
break;
449450
case kString:
450451
*Lookup<std::string>(info.field, options) = value;
Collapse file

‎test/sequential/test-cpu-prof-invalid-options.js‎

Copy file name to clipboardExpand all lines: test/sequential/test-cpu-prof-invalid-options.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,11 @@ const {
5858
}
5959

6060
// --cpu-prof-interval without --cpu-prof
61-
{
61+
for (const arg of [kCpuProfInterval, 'crashme']) {
6262
tmpdir.refresh();
6363
const output = spawnSync(process.execPath, [
6464
'--cpu-prof-interval',
65-
kCpuProfInterval,
65+
arg,
6666
fixtures.path('workload', 'fibonacci.js'),
6767
], {
6868
cwd: tmpdir.path,

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.