Skip to content

Commit

Permalink
wasi: address coverity warning
Browse files Browse the repository at this point in the history
- add check for case when trying to provide
  a better Exception fails
- the code was modified to avoid a CHECK_EQ in all
  cases in nodejs#31076,
  however, I believe that if we fail to create the exeption
  to throw instead of simply returning using a CHECK makes
  more sense. I think it should also address the coverity
  warning about not initializing in the constructor.

Signed-off-by: Michael Dawson <midawson@redhat.com>

PR-URL: nodejs#49866
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
  • Loading branch information
mhdawson authored and alexfernandez committed Nov 1, 2023
1 parent e407b3b commit 6e88292
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/node_wasi.cc
Expand Up @@ -83,8 +83,8 @@ WASI::WASI(Environment* env,
int err = uvwasi_init(&uvw_, options);
if (err != UVWASI_ESUCCESS) {
Local<Value> exception;
if (!WASIException(env->context(), err, "uvwasi_init").ToLocal(&exception))
return;
CHECK(
WASIException(env->context(), err, "uvwasi_init").ToLocal(&exception));

env->isolate()->ThrowException(exception);
}
Expand Down

0 comments on commit 6e88292

Please sign in to comment.