mirror of
https://github.com/NixOS/nix.git
synced 2025-11-11 04:56:01 +01:00
c39cc00404has 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. (cherry picked from commit6e78cc90d3)
12 lines
386 B
Text
12 lines
386 B
Text
error:
|
|
… from call site
|
|
at /pwd/lang/eval-fail-missing-arg-import.nix:1:1:
|
|
1| import ./non-eval-trivial-lambda-formals.nix { }
|
|
| ^
|
|
2|
|
|
|
|
error: function 'anonymous lambda' called without required argument 'a'
|
|
at /pwd/lang/non-eval-trivial-lambda-formals.nix:1:1:
|
|
1| { a }: a
|
|
| ^
|
|
2|
|