From 65e18aa8e7cd6b8ada0692ec444876514973420c Mon Sep 17 00:00:00 2001 From: Michael Dawson Date: Mon, 25 Sep 2023 20:49:32 +0000 Subject: [PATCH] wasi: address coverity warning - 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 https://github.com/nodejs/node/pull/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 PR-URL: https://github.com/nodejs/node/pull/49866 Reviewed-By: Colin Ihrig --- src/node_wasi.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/node_wasi.cc b/src/node_wasi.cc index e1a16c4e4b7d47..9c1707ec3ad230 100644 --- a/src/node_wasi.cc +++ b/src/node_wasi.cc @@ -83,8 +83,8 @@ WASI::WASI(Environment* env, int err = uvwasi_init(&uvw_, options); if (err != UVWASI_ESUCCESS) { Local exception; - if (!WASIException(env->context(), err, "uvwasi_init").ToLocal(&exception)) - return; + CHECK( + WASIException(env->context(), err, "uvwasi_init").ToLocal(&exception)); env->isolate()->ThrowException(exception); }