GDScript call stack as reverse linked list with fixed coroutines

* GDScript call stack as reverse linked list with issues fixed
(originally proposed in 91006).
* Fix coroutine issues with call stack by resuming async call chain
inside `GDScriptFunction::call()`.
* This fixes corrupted line numbers for coroutines in the debugger and
backtrace (106489).

Co-authored-by: Juan Linietsky <reduzio@gmail.com>
This commit is contained in:
Serhii Snitsaruk 2025-05-23 19:32:01 +02:00
parent e1b4101e34
commit a095c5e3fa
No known key found for this signature in database
GPG key ID: C658C84657FE945B
7 changed files with 90 additions and 79 deletions

View file

@ -575,6 +575,7 @@ public:
static constexpr int MAX_CALL_DEPTH = 2048; // Limit to try to avoid crash because of a stack overflow.
struct CallState {
Signal completed;
GDScript *script = nullptr;
GDScriptInstance *instance = nullptr;
#ifdef DEBUG_ENABLED