Skip to content

Commit 9bfc5d2

Browse files
committed
Don't move the arguments of the primOp
Moving arguments of the primOp into the registration structure makes it impossible to initialize a second EvalState with the correct primOp registration. It will end up registering all those "RegisterPrimOp"'s with an arity of zero on all but the 2nd instance of the EvalState. Not moving the memory will add a tiny bit of memory overhead during the eval since we need a copy of all the argument lists of all the primOp's. The overhead shouldn't be too bad as it is static (based on the amonut of registered operations) and only occurs once during the interpreter startup.
1 parent c55b397 commit 9bfc5d2

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/libexpr/primops.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3719,7 +3719,7 @@ void EvalState::createBaseEnv()
37193719
.fun = primOp.fun,
37203720
.arity = std::max(primOp.args.size(), primOp.arity),
37213721
.name = symbols.create(primOp.name),
3722-
.args = std::move(primOp.args),
3722+
.args = primOp.args,
37233723
.doc = primOp.doc,
37243724
});
37253725

0 commit comments

Comments
 (0)