Throw the async generator depth RangeError through scr_throw_error_msg

This commit is contained in:
Chris Tate
2026-10-26 08:22:47 -05:00
parent fe244085d4
commit 6a8650be5f
+4 -1
View File
@@ -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);