1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-09 12:06:01 +01:00

Silence false positive clang-analyzer warning in repl.cc

The clang-analyzer incorrectly flags a use-after-free for GC-managed objects
when used with std::unique_ptr. Since NixRepl inherits from gc, its memory
is properly managed by Boehm GC and this is a false positive.

Added NOLINTNEXTLINE directive to suppress the warning.
This commit is contained in:
Jörg Thalheim 2025-08-11 09:27:18 +02:00
parent e7af2e6566
commit 0675094861

View file

@ -917,6 +917,7 @@ ReplExitStatus AbstractNixRepl::runSimple(
return values;
};
LookupPath lookupPath = {};
// NOLINTNEXTLINE(clang-analyzer-cplusplus.NewDelete)
auto repl = std::make_unique<NixRepl>(
lookupPath,
openStore(),