1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-11 13:06:01 +01:00

nix_api_expr: always force values before giving them to the user

This commit is contained in:
Yorick van Pelt 2023-08-07 15:09:50 +02:00 committed by José Luis Lafuente
parent c48b9b8a83
commit 9cccb8bae0
No known key found for this signature in database
GPG key ID: 8A3455EBE455489A
4 changed files with 13 additions and 3 deletions

View file

@ -49,6 +49,7 @@ nix_err nix_expr_eval_from_string(nix_c_context *context, State *state,
nix::Expr *parsedExpr = state->state.parseExprFromString(
expr, state->state.rootPath(nix::CanonPath(path)));
state->state.eval(parsedExpr, *(nix::Value *)value);
state->state.forceValue(*(nix::Value *)value, nix::noPos);
}
NIXC_CATCH_ERRS
}
@ -60,6 +61,7 @@ nix_err nix_value_call(nix_c_context *context, State *state, Value *fn,
try {
state->state.callFunction(*(nix::Value *)fn, *(nix::Value *)arg,
*(nix::Value *)value, nix::noPos);
state->state.forceValue(*(nix::Value *)value, nix::noPos);
}
NIXC_CATCH_ERRS
}