1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-08 19:46:02 +01:00
nix/tests
Sergei Zimmerman 6e78cc90d3
libexpr: Fix invalid handling of errors for imported functions
c39cc00404 has added assertions for
all Value accesses and the following case has started failing with
an `unreachable`:

(/tmp/fun.nix):

```nix
{a}: a
```

```
$ nix eval --impure --expr 'import /tmp/fun.nix {a="a";b="b";}'
```

This would crash:

```
terminating due to unexpected unrecoverable internal error: Unexpected condition in getStorage at ../include/nix/expr/value.hh:844
```

This is not a regression, but rather surfaces an existing problem, which previously
was left undiagnosed. In the case of an import `fun` is the `import` primOp, so that read is invalid
and previously this resulted in an access into an inactive union member, which is UB.
The correct thing to use is `vCur`. Identical problem also affected the case of a missing argument.

Add previously failing test cases to the functional/lang test suite.

Fixes #13448.
2025-07-11 20:20:48 +03:00
..
functional libexpr: Fix invalid handling of errors for imported functions 2025-07-11 20:20:48 +03:00
installer Format .nix files 2025-01-24 17:04:02 +01:00
nixos installers, tests: remove --preserve=mode from cp invocations 2025-07-07 15:34:18 -06:00
repl-completion.nix Format .nix files 2025-01-24 17:04:02 +01:00