1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-08 19:46:02 +01:00

Merge pull request #14453 from Radvendii/exprwith-alloc

libexpr: shrink ExprWith by 8 bytes
This commit is contained in:
John Ericson 2025-11-04 18:04:25 +00:00 committed by GitHub
commit 2b382b171c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 1 deletions

View file

@ -637,8 +637,8 @@ struct ExprLet : Expr
struct ExprWith : Expr
{
PosIdx pos;
uint32_t prevWith;
Expr *attrs, *body;
size_t prevWith;
ExprWith * parentWith;
ExprWith(const PosIdx & pos, Expr * attrs, Expr * body)
: pos(pos)

View file

@ -523,6 +523,7 @@ void ExprWith::bindVars(EvalState & es, const std::shared_ptr<const StaticEnv> &
prevWith = 0;
for (curEnv = env.get(), level = 1; curEnv; curEnv = curEnv->up.get(), level++)
if (curEnv->isWith) {
assert(level <= std::numeric_limits<uint32_t>::max());
prevWith = level;
break;
}