aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr/eval.hh
diff options
context:
space:
mode:
authoreldritch horrors <pennae@lix.systems>2024-03-04 07:35:20 +0100
committereldritch horrors <pennae@lix.systems>2024-03-04 07:35:20 +0100
commit96f1a404d08d1dd00ef395bcdc53c7599c860ecf (patch)
treec2c10849ccfa865ae649be873fa9ed0d6d4d4da6 /src/libexpr/eval.hh
parente1b1e6f7abb62b7e86a1d12aead1bd931089cd7a (diff)
Merge pull request #9617 from 9999years/stack-overflow-segfault
Fix segfault on infinite recursion in some cases (cherry picked from commit bf1b294bd81ca76c5ec9fe3ecd52196bf52a8300) Change-Id: Id137541426ec8536567835953fccf986a3aebf16
Diffstat (limited to 'src/libexpr/eval.hh')
-rw-r--r--src/libexpr/eval.hh5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/libexpr/eval.hh b/src/libexpr/eval.hh
index 20ea7b704..4cbd45013 100644
--- a/src/libexpr/eval.hh
+++ b/src/libexpr/eval.hh
@@ -629,6 +629,11 @@ private:
const SourcePath & basePath,
std::shared_ptr<StaticEnv> & staticEnv);
+ /**
+ * Current Nix call stack depth, used with `max-call-depth` setting to throw stack overflow hopefully before we run out of system stack.
+ */
+ size_t callDepth = 0;
+
public:
/**