mirror of
https://github.com/NixOS/nix.git
synced 2025-11-08 11:36:03 +01:00
libexpr: shrink ExprWith by 8 bytes
Correct bound on prevWith Co-authored-by: John Ericson <git@JohnEricson.me>
This commit is contained in:
parent
2d83bc6b83
commit
11e19ee690
2 changed files with 2 additions and 1 deletions
|
|
@ -637,8 +637,8 @@ struct ExprLet : Expr
|
||||||
struct ExprWith : Expr
|
struct ExprWith : Expr
|
||||||
{
|
{
|
||||||
PosIdx pos;
|
PosIdx pos;
|
||||||
|
uint32_t prevWith;
|
||||||
Expr *attrs, *body;
|
Expr *attrs, *body;
|
||||||
size_t prevWith;
|
|
||||||
ExprWith * parentWith;
|
ExprWith * parentWith;
|
||||||
ExprWith(const PosIdx & pos, Expr * attrs, Expr * body)
|
ExprWith(const PosIdx & pos, Expr * attrs, Expr * body)
|
||||||
: pos(pos)
|
: pos(pos)
|
||||||
|
|
|
||||||
|
|
@ -523,6 +523,7 @@ void ExprWith::bindVars(EvalState & es, const std::shared_ptr<const StaticEnv> &
|
||||||
prevWith = 0;
|
prevWith = 0;
|
||||||
for (curEnv = env.get(), level = 1; curEnv; curEnv = curEnv->up.get(), level++)
|
for (curEnv = env.get(), level = 1; curEnv; curEnv = curEnv->up.get(), level++)
|
||||||
if (curEnv->isWith) {
|
if (curEnv->isWith) {
|
||||||
|
assert(level <= std::numeric_limits<uint32_t>::max());
|
||||||
prevWith = level;
|
prevWith = level;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue