1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-28 17:51:15 +02:00

libexpr: Add missing GC root for baseEnv

This missing GC root wasn't much of a problem before, because the
heap would end up with a reference to the `baseEnv` pretty soon,
but when unit testing, the construction of `EvalState` doesn't
necessarily happen well before GC runs for the first time.

Found while unit testing the Rust bindings that currently reside
at https://github.com/nixops4/nixops4/tree/main/rust
This commit is contained in:
Robert Hensing 2024-05-01 18:47:19 +02:00
parent e17aad23d6
commit f34b52b521
2 changed files with 12 additions and 1 deletions

View file

@ -547,6 +547,11 @@ public:
*/
SingleDerivedPath coerceToSingleDerivedPath(const PosIdx pos, Value & v, std::string_view errorCtx);
#if HAVE_BOEHMGC
/** A GC root for the baseEnv reference. */
std::shared_ptr<Env *> baseEnvP;
#endif
public:
/**