mirror of
https://github.com/NixOS/nix.git
synced 2025-11-21 01:39:36 +01:00
libexpr: allocate ExprSelect's AttrName vector in Expr::alloc
This commit is contained in:
parent
d5d7ca01b3
commit
76a92985d7
4 changed files with 42 additions and 20 deletions
|
|
@ -57,7 +57,7 @@ void ExprSelect::show(const SymbolTable & symbols, std::ostream & str) const
|
|||
{
|
||||
str << "(";
|
||||
e->show(symbols, str);
|
||||
str << ")." << showAttrPath(symbols, attrPath);
|
||||
str << ")." << showAttrPath(symbols, getAttrPath());
|
||||
if (def) {
|
||||
str << " or (";
|
||||
def->show(symbols, str);
|
||||
|
|
@ -261,7 +261,7 @@ void ExprPos::show(const SymbolTable & symbols, std::ostream & str) const
|
|||
str << "__curPos";
|
||||
}
|
||||
|
||||
std::string showAttrPath(const SymbolTable & symbols, const AttrPath & attrPath)
|
||||
std::string showAttrPath(const SymbolTable & symbols, std::span<const AttrName> attrPath)
|
||||
{
|
||||
std::ostringstream out;
|
||||
bool first = true;
|
||||
|
|
@ -362,7 +362,7 @@ void ExprSelect::bindVars(EvalState & es, const std::shared_ptr<const StaticEnv>
|
|||
e->bindVars(es, env);
|
||||
if (def)
|
||||
def->bindVars(es, env);
|
||||
for (auto & i : attrPath)
|
||||
for (auto & i : getAttrPath())
|
||||
if (!i.symbol)
|
||||
i.expr->bindVars(es, env);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue