From 6a8650be5f36e22a744c2e3b01183bf389fc9fca Mon Sep 17 00:00:00 2001 From: Chris Tate Date: Mon, 26 Oct 2026 08:22:47 -0500 Subject: [PATCH] Throw the async generator depth RangeError through scr_throw_error_msg --- packages/runtime/src/scr_async.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/runtime/src/scr_async.c b/packages/runtime/src/scr_async.c index 49ab8ef2f1..aed974892c 100644 --- a/packages/runtime/src/scr_async.c +++ b/packages/runtime/src/scr_async.c @@ -5868,7 +5868,10 @@ __attribute__((always_inline)) static inline void scr_gen_coro_hop(ScrGen *g, bo static __attribute__((noinline)) void scr_async_gen_coro_in(ScrGen *g) { uintptr_t guard = scr_stack_guard; if (guard != 0 && (uintptr_t)__builtin_frame_address(0) < guard) { - scr_stack_overflow(); + /* scr_stack_overflow's error, thrown here: this unit links without + * scr_context.c in the runtime's own tests. */ + static const char text[] = "Maximum call stack size exceeded"; + scr_throw_error_msg(SCR_ERR_RANGE, text, sizeof text - 1); return; } scr_gen_coro_hop(g, true, false);