Do not check function call depth if no_function.
This commit is contained in:
parent
30782212e4
commit
e84d4a88e9
@ -608,10 +608,13 @@ impl Engine {
|
|||||||
let native_only = hashes.1 == 0;
|
let native_only = hashes.1 == 0;
|
||||||
|
|
||||||
// Check for stack overflow
|
// Check for stack overflow
|
||||||
if level > self.max_call_stack_depth {
|
#[cfg(not(feature = "no_function"))]
|
||||||
return Err(Box::new(EvalAltResult::ErrorStackOverflow(pos)));
|
#[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)
|
// First search in script-defined functions (can override built-in)
|
||||||
if !native_only {
|
if !native_only {
|
||||||
if let Some(fn_def) = lib.get(&hashes.1) {
|
if let Some(fn_def) = lib.get(&hashes.1) {
|
||||||
|
Loading…
Reference in New Issue
Block a user