1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-06 09:11:47 +02:00

Mark Value pointers in Value::elems as const

This catches modification of finalized values (e.g. in prim_sort).
This commit is contained in:
Eelco Dolstra 2024-03-15 18:22:39 +01:00
parent fecff520d7
commit 3e6730ee62
4 changed files with 7 additions and 6 deletions

View file

@ -246,7 +246,7 @@ public:
Bindings * attrs;
struct {
size_t size;
Value * * elems;
Value * const * elems;
} bigList;
Value * smallList[2];
ClosureThunk thunk;
@ -425,7 +425,7 @@ public:
return internalType == tList1 || internalType == tList2 || internalType == tListN;
}
Value * * listElems()
Value * const * listElems()
{
return internalType == tList1 || internalType == tList2 ? smallList : bigList.elems;
}