diff options
author | Kevin Amado <kamadorueda@gmail.com> | 2021-11-13 20:29:31 -0500 |
---|---|---|
committer | Kevin Amado <kamadorueda@gmail.com> | 2021-11-13 20:33:34 -0500 |
commit | d0e9e184895b62d193a6eff5e332a338d3664e5b (patch) | |
tree | a4f3a9afadd11b15d68e660ac217f83e773c943d /src/libexpr/primops.cc | |
parent | bceda304982a34c65d5a1dab449cb5bc59f63b83 (diff) |
toXML: display errors position
- This change applies to builtins.toXML and inner workings
- Proof of concept:
```nix
let e = builtins.toXML e; in e
```
- Before:
```
$ nix-instantiate --eval poc.nix
error: infinite recursion encountered
```
- After:
```
$ nix-instantiate --eval poc.nix
error: infinite recursion encountered
at /data/github/kamadorueda/nix/poc.nix:1:9:
1| let e = builtins.toXML e; in e
|
```
Diffstat (limited to 'src/libexpr/primops.cc')
-rw-r--r-- | src/libexpr/primops.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc index aaeafb931..668ad00ec 100644 --- a/src/libexpr/primops.cc +++ b/src/libexpr/primops.cc @@ -1582,7 +1582,7 @@ static void prim_toXML(EvalState & state, const Pos & pos, Value * * args, Value { std::ostringstream out; PathSet context; - printValueAsXML(state, true, false, *args[0], out, context); + printValueAsXML(state, true, false, *args[0], out, context, pos); mkString(v, out.str(), context); } |