Skip to content

Commit

Permalink
CraterCrashGH-68 Fix max_call_stack property key
Browse files Browse the repository at this point in the history
  • Loading branch information
Naros committed Jan 12, 2024
1 parent f2e3766 commit 4cc3280
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/plugin/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,10 @@ void OrchestratorSettings::_register_settings()
{
// Orchestrator v2
_settings.emplace_back(RESOURCE_SETTING("settings/default_type", "Object", "Node"));
_settings.emplace_back(RANGE_SETTING("settings/runtime_max_call_stack", "256,1024", 1024));
_settings.emplace_back(SENUM_SETTING("settings/log_level", "FATAL,ERROR,WARN,INFO,DEBUG,TRACE", "INFO"));
_settings.emplace_back(BOOL_SETTING("settings/save_copy_as_text_resource", false));

_settings.emplace_back(RANGE_SETTING("settings/runtime/max_call_stack", "256,1024,256", 1024));
_settings.emplace_back(INT_SETTING("settings/runtime/max_loop_iterations", 1000000));
_settings.emplace_back(BOOL_SETTING("settings/runtime/tickable", true));

Expand Down
6 changes: 5 additions & 1 deletion src/script/instances/script_instance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -731,10 +731,14 @@ void OScriptInstance::call(const StringName& p_method, const Variant* const* p_a
// settings/runtime/max_call_stack
OrchestratorSettings* os = OrchestratorSettings::get_singleton();
int max_call_stack = os->get_setting("settings/runtime/max_call_stack");
if (f->max_stack > max_call_stack)
{
ERR_FAIL_MSG("Unable to call function, call stack exceeds " + itos(max_call_stack));
}

// Setup the OScriptExecutionStackInfo object
OScriptExecutionStackInfo si;
si.max_stack_size = max_call_stack; //! Max Call Stack
si.max_stack_size = f->max_stack; //! Max Call Stack
si.node_count = f->node_count; //! Number of nodes
si.max_inputs = _max_input_args; //! max input arguments
si.max_outputs = _max_output_args; //! max output arguments
Expand Down

0 comments on commit 4cc3280

Please sign in to comment.