nix_api_value: fix primop arity

This commit is contained in:
Puck Meerburg 2023-07-23 11:32:17 +00:00 committed by José Luis Lafuente
parent e76652a5d3
commit 748b322ddd
No known key found for this signature in database
GPG key ID: 8A3455EBE455489A

View file

@ -42,7 +42,11 @@ PrimOp *nix_alloc_primop(nix_c_context *context, PrimOpFun fun, int arity,
#ifdef HAVE_BOEHMGC
(GC)
#endif
nix::PrimOp{.name = name, .args = {}, .doc = doc, .fun = fun2};
nix::PrimOp{.name = name,
.args = {},
.arity = (size_t)arity,
.doc = doc,
.fun = fun2};
if (args)
for (size_t i = 0; args[i]; i++)
p->args.emplace_back(*args);