From e84d4a88e9947975643a0098a7385e4f6f1969ad Mon Sep 17 00:00:00 2001 From: Stephen Chung Date: Thu, 28 May 2020 14:08:07 +0800 Subject: [PATCH] Do not check function call depth if no_function. --- src/engine.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/engine.rs b/src/engine.rs index a96bae7b..80b84110 100644 --- a/src/engine.rs +++ b/src/engine.rs @@ -608,10 +608,13 @@ impl Engine { let native_only = hashes.1 == 0; // Check for stack overflow - if level > self.max_call_stack_depth { - return Err(Box::new(EvalAltResult::ErrorStackOverflow(pos))); + #[cfg(not(feature = "no_function"))] + #[cfg(not(feature = "unchecked"))] + { + if level > self.max_call_stack_depth { + return Err(Box::new(EvalAltResult::ErrorStackOverflow(pos))); + } } - // First search in script-defined functions (can override built-in) if !native_only { if let Some(fn_def) = lib.get(&hashes.1) {