summaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
authorBen Bridle <ben@derelict.engineering>2025-10-15 13:25:28 +1300
committerBen Bridle <ben@derelict.engineering>2025-10-15 13:25:28 +1300
commita4c2b3ae304dc53e8e52cc952383b5171ce00b99 (patch)
tree9f893524673a4a028c9a744b84a624ca0d79ac89 /src/lib.rs
parentc62da877b370392accfbd8a1087ad5673b6f55e4 (diff)
downloadtorque-asm-a4c2b3ae304dc53e8e52cc952383b5171ce00b99.zip
Raise an error if recursion depth exceeds a maximum value
This is preferable to having the assembler crash with a stack overflow error, because the user can now see which invocation caused the overflow.
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 9b9b87a..09e2fbb 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1,4 +1,5 @@
const MAX_ITERATIONS_TO_STABILISE: usize = 4;
+const MAX_RECURSION_DEPTH: usize = 1024;
mod stages;
mod types;