diff options
author | eldritch horrors <pennae@lix.systems> | 2024-06-16 23:10:09 +0200 |
---|---|---|
committer | eldritch horrors <pennae@lix.systems> | 2024-06-17 19:46:44 +0000 |
commit | ad5366c2ad43216ac9a61ccb1477ff9859d1a75c (patch) | |
tree | e986b1f0e9510641279bba164b36bae9a96be6be /src/libexpr/value.hh | |
parent | b8f49a8eaf619df6d228f2e0f9814c4a5fa4aec5 (diff) |
libexpr: pass Exprs as references, not pointers
almost all places where Exprs are passed as pointers expect the pointers
to be non-null. pass them as references to encode this constraint in the
type system as well (and also communicate that Exprs must not be freed).
Change-Id: Ia98f166fec3c23151f906e13acb4a0954a5980a2
Diffstat (limited to 'src/libexpr/value.hh')
-rw-r--r-- | src/libexpr/value.hh | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libexpr/value.hh b/src/libexpr/value.hh index 17a85f1de..dcef82e40 100644 --- a/src/libexpr/value.hh +++ b/src/libexpr/value.hh @@ -323,11 +323,11 @@ public: } } - inline void mkThunk(Env * e, Expr * ex) + inline void mkThunk(Env * e, Expr & ex) { internalType = tThunk; thunk.env = e; - thunk.expr = ex; + thunk.expr = &ex; } inline void mkApp(Value * l, Value * r) |