libexpr: fix --debugger --ignore-try

a65e9e5828 did not inform `tryEval` that
(as far as it's concerned) `state.debug` moved to `state.errors.debug`
and changed types. this resulted in the REPL erroneously coming up, that
REPL having a non-debug state, and segfaulting after that REPL exited.

it's probably good that `state.debug` isn't mutated by `--ignore-try`
anymore.

Change-Id: I1918e93edacd626452aa423fc2eb825080738835
Fixes: a65e9e5828 ("libexpr: extract eval error creation into new type")
Signed-off-by: Dusk Banks <me@bb010g.com>
(cherry picked from commit 6a583136b7)
This commit is contained in:
Dusk Banks
2025-01-31 12:36:14 +00:00
committed by eldritch horrors
parent d2b1af70ee
commit 5fa27057b2
4 changed files with 43 additions and 20 deletions
@@ -0,0 +1,8 @@
@args --debugger --ignore-try
we don't enter a debug repl through tryEval
nix-repl> (builtins.tryEval ((x: throw "foo") 1)).success
false
no segfault either
nix-repl> :quit
@@ -187,5 +187,6 @@ REPL_TEST(stack_vars);
REPL_TEST(errors);
REPL_TEST(idempotent);
REPL_TEST(debug_frames);
REPL_TEST(debug_ignore_try);
}; // namespace nix