From 1a9d4c828eda6cca6773099eb15f187b58246999 Mon Sep 17 00:00:00 2001 From: RafaelGSS Date: Mon, 26 Feb 2024 14:22:24 -0300 Subject: [PATCH] src,build: adjust suppressions file and ub on src Co-Authored-By: Santiago Gimeno --- src/spawn_sync.cc | 3 ++- suppressions.supp | 8 ++++++-- test/parallel/test-node-output-console.mjs | 6 +++++- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/spawn_sync.cc b/src/spawn_sync.cc index 3b73dc4a614b9a..90ce14d06be6fc 100644 --- a/src/spawn_sync.cc +++ b/src/spawn_sync.cc @@ -68,7 +68,8 @@ void SyncProcessOutputBuffer::OnRead(const uv_buf_t* buf, size_t nread) { size_t SyncProcessOutputBuffer::Copy(char* dest) const { - memcpy(dest, data_, used()); + if (dest != nullptr) + memcpy(dest, data_, used()); return used(); } diff --git a/suppressions.supp b/suppressions.supp index 4f2d3793d72bc3..9dc89fb83df5b4 100644 --- a/suppressions.supp +++ b/suppressions.supp @@ -1,2 +1,6 @@ -undefined-behavior:deps/icu-small/source/common/uloc_tag.cpp -undefined-behavior:deps/v8/* +vptr:deps/icu-small/source/common/uloc_tag.cpp +vptr:deps/icu-small/source/common/unistr.cpp +shift-base:deps/v8/src/wasm/decoder.h +vptr:deps/icu-small/source/common/sharedobject.cpp +vptr:deps/icu-small/source/i18n/coll.cpp +nonnull-attribute:deps/v8/src/snapshot/snapshot-source-sink.h diff --git a/test/parallel/test-node-output-console.mjs b/test/parallel/test-node-output-console.mjs index 5a1b9feb6c8bed..f995c170540ffa 100644 --- a/test/parallel/test-node-output-console.mjs +++ b/test/parallel/test-node-output-console.mjs @@ -31,7 +31,11 @@ describe('console output', { concurrency: true }, () => { .transform(snapshot.replaceWindowsLineEndings, snapshot.replaceWindowsPaths, replaceStackTrace); for (const { name, transform, env } of tests) { it(name, async () => { - await snapshot.spawnAndAssert(fixtures.path(name), transform ?? defaultTransform, { env }); + await snapshot.spawnAndAssert( + fixtures.path(name), + transform ?? defaultTransform, + { env: { ...env, ...process.env } }, + ); }); } });