Skip to content

Commit

Permalink
src: address coverity warning in module_wrap.cc
Browse files Browse the repository at this point in the history
- remove copying as suggested by coverity

Signed-off-by: Michael Dawson <midawson@redhat.com>
PR-URL: nodejs#52143
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
  • Loading branch information
mhdawson authored and anonrig committed Mar 25, 2024
1 parent f123196 commit 7598315
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/module_wrap.cc
Expand Up @@ -128,7 +128,7 @@ v8::Maybe<bool> ModuleWrap::CheckUnsettledTopLevelAwait() {
}

if (env()->options()->warnings) {
for (auto pair : stalled) {
for (auto& pair : stalled) {
Local<v8::Message> message = std::get<1>(pair);

std::string reason = "Warning: Detected unsettled top-level await at ";
Expand Down
5 changes: 3 additions & 2 deletions src/node_file.cc
Expand Up @@ -1042,8 +1042,9 @@ static void ExistsSync(const FunctionCallbackInfo<Value>& args) {
static void InternalModuleStat(const FunctionCallbackInfo<Value>& args) {
Environment* env = Environment::GetCurrent(args);

CHECK(args[0]->IsString());
node::Utf8Value path(env->isolate(), args[0]);
BufferValue path(env->isolate(), args[0]);
CHECK_NOT_NULL(*path);
ToNamespacedPath(env, &path);
THROW_IF_INSUFFICIENT_PERMISSIONS(
env, permission::PermissionScope::kFileSystemRead, path.ToStringView());

Expand Down

0 comments on commit 7598315

Please sign in to comment.