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 <[email protected]>

PR-URL: nodejs#49866
Reviewed-By: Colin Ihrig <[email protected]>
  • Loading branch information
mhdawson committed Oct 12, 2023
1 parent d398529 commit c1a3a98
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/node_wasi.cc
Original file line number Diff line number Diff line change
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 c1a3a98

Please sign in to comment.