From 6818c225318f3c397b02447c9ad5863e3725467e 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 --- 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); }