Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/libexpr/eval.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1366,7 +1366,12 @@ void ExprAttrs::eval(EvalState & state, Env & env, Value & v)
sort = true;
}

bindings.bindings->pos = pos;
/* Empty attrsets share the static Bindings::emptyBindings, which we
must not write to: apart from being a data race, it causes false
sharing on emptyBindings' cache line (which may also hold other hot
globals such as Counter::enabled) between all evaluator threads. */
if (bindings.bindings != &Bindings::emptyBindings)
bindings.bindings->pos = pos;

v.mkAttrs(sort ? bindings.finish() : bindings.alreadySorted());
}
Expand Down
Loading