aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr/primops.cc
diff options
context:
space:
mode:
authorvolth <volth@volth.com>2018-07-06 21:49:51 +0000
committervolth <volth@volth.com>2018-07-06 21:52:54 +0000
commit627e28ba332f21109d7eace8ba0a7932e4d98b2e (patch)
tree4ecbeffdf7a7d5cb86b106b9b9ab78b5ea06bf69 /src/libexpr/primops.cc
parentaa64e95bc82b3a57f3a645a746aacf4d2479266e (diff)
prim_mapAttrs: `f' must be evaluated lazily to avoid infinite recursion
Diffstat (limited to 'src/libexpr/primops.cc')
-rw-r--r--src/libexpr/primops.cc3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc
index e71e3a6d4..e7b319fea 100644
--- a/src/libexpr/primops.cc
+++ b/src/libexpr/primops.cc
@@ -1359,7 +1359,6 @@ static void prim_functionArgs(EvalState & state, const Pos & pos, Value * * args
/* Apply a function to every element of an attribute set. */
static void prim_mapAttrs(EvalState & state, const Pos & pos, Value * * args, Value & v)
{
- state.forceFunction(*args[0], pos);
state.forceAttrs(*args[1], pos);
state.mkAttrs(v, args[1]->attrs->size());
@@ -1368,7 +1367,7 @@ static void prim_mapAttrs(EvalState & state, const Pos & pos, Value * * args, Va
Value * vName = state.allocValue();
Value * vFun2 = state.allocValue();
mkString(*vName, i.name);
- state.callFunction(*args[0], *vName, *vFun2, pos);
+ mkApp(*vFun2, *args[0], *vName);
mkApp(*state.allocAttr(v, i.name), *vFun2, *i.value);
}
}