aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authoreldritch horrors <pennae@lix.systems>2024-03-18 21:09:39 +0100
committereldritch horrors <pennae@lix.systems>2024-03-18 14:15:22 -0700
commitafb839a0c9888bc8b98c0dd4abd28c79d754c250 (patch)
tree524b05762d4820b338bde66b4fd5fa03b6bfc083 /tests
parentb3599166ad98c3cad304183bd7cc7bc280522e71 (diff)
libexpr: associate let exprs with the correct StaticEnv
static env association is from expr to its enclosing scope, but let exprs set their association to their *inner* scope. this skips one level of envs and will cause segfaults if the parent is a with expr. fixes #145 Change-Id: I1d22146110f071ede21b4eed7ed34b5850ef2ef3
Diffstat (limited to 'tests')
-rw-r--r--tests/functional/repl_characterization/data/regression_l145.nix5
-rw-r--r--tests/functional/repl_characterization/data/regression_l145.test14
-rw-r--r--tests/functional/repl_characterization/repl_characterization.cc1
3 files changed, 20 insertions, 0 deletions
diff --git a/tests/functional/repl_characterization/data/regression_l145.nix b/tests/functional/repl_characterization/data/regression_l145.nix
new file mode 100644
index 000000000..26bcdb3fa
--- /dev/null
+++ b/tests/functional/repl_characterization/data/regression_l145.nix
@@ -0,0 +1,5 @@
+with { inherit ({}) invalid; };
+let
+ x = builtins.break 1;
+in
+ x
diff --git a/tests/functional/repl_characterization/data/regression_l145.test b/tests/functional/repl_characterization/data/regression_l145.test
new file mode 100644
index 000000000..2fe04d221
--- /dev/null
+++ b/tests/functional/repl_characterization/data/regression_l145.test
@@ -0,0 +1,14 @@
+ info: breakpoint reached
+
+debugger should not crash now, but also not show any with variables
+ nix-repl> :st
+ 0: error: breakpoint reached
+ «none»:0
+ Env level 0
+ static: x
+
+ Env level 1
+ static:
+
+ Env level 2
+ abort baseNameOf break builtins derivation derivationStrict dirOf false fetchGit fetchMercurial fetchTarball fetchTree fromTOML import isNull map null placeholder removeAttrs scopedImport throw toString true
diff --git a/tests/functional/repl_characterization/repl_characterization.cc b/tests/functional/repl_characterization/repl_characterization.cc
index 7aa7dac5c..d0c3b0a71 100644
--- a/tests/functional/repl_characterization/repl_characterization.cc
+++ b/tests/functional/repl_characterization/repl_characterization.cc
@@ -124,6 +124,7 @@ TEST_F(ReplSessionTest, repl_basic)
DEBUGGER_TEST(regression_9918);
DEBUGGER_TEST(regression_9917);
+DEBUGGER_TEST(regression_l145);
DEBUGGER_TEST(stack_vars);
};