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 #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: #49866
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
  • Loading branch information
mhdawson authored and targos committed Nov 11, 2023
1 parent b5aeceb commit 65e18aa
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 65e18aa

Please sign in to comment.