GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — src: fix coverity coverity warning by mhdawson · Pull Request #50846 · nodejs/node

Conversation

@mhdawson

@mhdawson mhdawson commented Nov 21, 2023

Copy link
Copy Markdown
Member
  • reduce copying by using std::move

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

bricss reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. vm Issues and PRs related to the vm subsystem. labels Nov 21, 2023
@mhdawson

mhdawson commented Nov 21, 2023 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author

Coverity warning

 std::vector<Local<String>> params = {
1464      String::NewFromUtf8(isolate, "exports").ToLocalChecked(),
1465      String::NewFromUtf8(isolate, "require").ToLocalChecked(),
1466      String::NewFromUtf8(isolate, "module").ToLocalChecked(),
1467      String::NewFromUtf8(isolate, "__filename").ToLocalChecked(),
1468      String::NewFromUtf8(isolate, "__dirname").ToLocalChecked()};
1469
1470  TryCatchScope try_catch(env);
1471
1472  ContextifyContext::CompileFunctionAndCacheResult(env,
1473                                                   context,
1474                                                   &source,
    	
CID 329955 (#1 of 1): COPY_INSTEAD_OF_MOVE (COPY_INSTEAD_OF_MOVE)
1. copy_constructor_call: params is passed-by-value as parameter to CompileFunctionAndCacheResult when it could be moved instead.
    	Use std::move(params) instead of params.
1475                                                   params,
1476                                                   std::vector<Local<Object>>(),
1477                                                   options,
1478                                                   true,
1479                                                   id_symbol,
1480                                                   try_catch);

I think the suggested std::move will avoid copying the contents of the vector.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

tniessen
tniessen approved these changes Nov 21, 2023
View reviewed changes
@tniessen

tniessen commented Nov 21, 2023

Copy link
Copy Markdown
Member

Nit: duplicate word in commit message

H4ad reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mhdawson
src: fix coverity warning
9b4b586
- reduce copying by using std::move

Signed-off-by: Michael Dawson <[email protected]>
@mhdawson
mhdawson force-pushed the coverity42 branch from 8824683 to 9b4b586 Compare November 22, 2023 15:24
@mhdawson

mhdawson commented Nov 22, 2023 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author

@tniessen thanks, fixed commit message.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mhdawson mhdawson added the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Nov 22, 2023
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Nov 22, 2023
@nodejs-github-bot

nodejs-github-bot commented Nov 22, 2023

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/55856/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

marco-ippolito
marco-ippolito approved these changes Nov 22, 2023
View reviewed changes
@nodejs-github-bot

nodejs-github-bot commented Nov 23, 2023

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/55879/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nodejs-github-bot

nodejs-github-bot commented Nov 23, 2023

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/55883/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

jasnell
jasnell approved these changes Nov 24, 2023
View reviewed changes
lpinca
lpinca approved these changes Nov 24, 2023
View reviewed changes
@lpinca lpinca added the commit-queue PRs queued for automated landing through the Commit Queue. label Nov 24, 2023
@nodejs-github-bot nodejs-github-bot removed the commit-queue PRs queued for automated landing through the Commit Queue. label Nov 24, 2023
@nodejs-github-bot
nodejs-github-bot merged commit 6dbf678 into nodejs:main Nov 24, 2023
@nodejs-github-bot

nodejs-github-bot commented Nov 24, 2023

Copy link
Copy Markdown
Collaborator

Landed in 6dbf678

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

lucshi pushed a commit to lucshi/node that referenced this pull request Nov 27, 2023
@mhdawson Lei Shi
src: fix coverity warning
ee14a96
- reduce copying by using std::move

Signed-off-by: Michael Dawson <[email protected]>
PR-URL: nodejs#50846
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Marco Ippolito <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
RafaelGSS pushed a commit that referenced this pull request Nov 27, 2023
@mhdawson @RafaelGSS
src: fix coverity warning
9c56ca9
- reduce copying by using std::move

Signed-off-by: Michael Dawson <[email protected]>
PR-URL: #50846
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Marco Ippolito <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
@RafaelGSS RafaelGSS mentioned this pull request Nov 28, 2023
v21.3.0 proposal #50954
Merged
RafaelGSS pushed a commit that referenced this pull request Nov 29, 2023
@mhdawson @RafaelGSS
src: fix coverity warning
fd9195d
- reduce copying by using std::move

Signed-off-by: Michael Dawson <[email protected]>
PR-URL: #50846
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Marco Ippolito <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
UlisesGascon pushed a commit that referenced this pull request Dec 11, 2023
@mhdawson @UlisesGascon
src: fix coverity warning
f504512
- reduce copying by using std::move

Signed-off-by: Michael Dawson <[email protected]>
PR-URL: #50846
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Marco Ippolito <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
@UlisesGascon UlisesGascon mentioned this pull request Dec 12, 2023
v20.11.0 proposal #51124
Merged
UlisesGascon pushed a commit that referenced this pull request Dec 13, 2023
@mhdawson @UlisesGascon
src: fix coverity warning
f79b9f8
- reduce copying by using std::move

Signed-off-by: Michael Dawson <[email protected]>
PR-URL: #50846
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Marco Ippolito <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
UlisesGascon pushed a commit that referenced this pull request Dec 15, 2023
@mhdawson @UlisesGascon
src: fix coverity warning
ba56d6f
- reduce copying by using std::move

Signed-off-by: Michael Dawson <[email protected]>
PR-URL: #50846
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Marco Ippolito <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
UlisesGascon pushed a commit that referenced this pull request Dec 19, 2023
@mhdawson @UlisesGascon
src: fix coverity warning
158db2d
- reduce copying by using std::move

Signed-off-by: Michael Dawson <[email protected]>
PR-URL: #50846
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Marco Ippolito <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@jasnell jasnell jasnell approved these changes
@lpinca lpinca lpinca approved these changes
@tniessen tniessen tniessen approved these changes
@marco-ippolito marco-ippolito marco-ippolito approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. vm Issues and PRs related to the vm subsystem.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

6 participants

@mhdawson @tniessen @nodejs-github-bot @jasnell @lpinca @marco-ippolito
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.