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:
parent
fecff520d7
commit
3e6730ee62
4 changed files with 7 additions and 6 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue