mirror of
https://github.com/NixOS/nix
synced 2025-07-04 23:51:47 +02:00
libexpr: always initialize displacement
Otherwise the value is undefined in some cases.
This commit is contained in:
parent
2baab6412f
commit
d8117c8c0d
1 changed files with 2 additions and 2 deletions
|
@ -168,7 +168,7 @@ struct ExprVar : Expr
|
|||
the set stored in the environment that is `level` levels up
|
||||
from the current one.*/
|
||||
Level level;
|
||||
Displacement displ;
|
||||
Displacement displ = 0;
|
||||
|
||||
ExprVar(Symbol name) : name(name) { };
|
||||
ExprVar(const PosIdx & pos, Symbol name) : pos(pos), name(name) { };
|
||||
|
@ -242,7 +242,7 @@ struct ExprAttrs : Expr
|
|||
Kind kind;
|
||||
Expr * e;
|
||||
PosIdx pos;
|
||||
Displacement displ; // displacement
|
||||
Displacement displ = 0; // displacement
|
||||
AttrDef(Expr * e, const PosIdx & pos, Kind kind = Kind::Plain)
|
||||
: kind(kind), e(e), pos(pos) { };
|
||||
AttrDef() { };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue