Skip to content

Commit 2b382b1

Browse files
authored
Merge pull request NixOS#14453 from Radvendii/exprwith-alloc
libexpr: shrink ExprWith by 8 bytes
2 parents b755337 + 11e19ee commit 2b382b1

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/libexpr/include/nix/expr/nixexpr.hh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -637,8 +637,8 @@ struct ExprLet : Expr
637637
struct ExprWith : Expr
638638
{
639639
PosIdx pos;
640+
uint32_t prevWith;
640641
Expr *attrs, *body;
641-
size_t prevWith;
642642
ExprWith * parentWith;
643643
ExprWith(const PosIdx & pos, Expr * attrs, Expr * body)
644644
: pos(pos)

src/libexpr/nixexpr.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -523,6 +523,7 @@ void ExprWith::bindVars(EvalState & es, const std::shared_ptr<const StaticEnv> &
523523
prevWith = 0;
524524
for (curEnv = env.get(), level = 1; curEnv; curEnv = curEnv->up.get(), level++)
525525
if (curEnv->isWith) {
526+
assert(level <= std::numeric_limits<uint32_t>::max());
526527
prevWith = level;
527528
break;
528529
}

0 commit comments

Comments
 (0)