From be7c97ce6ae43d677b28d455506fdaedf944a25b Mon Sep 17 00:00:00 2001 From: Xavier Del Campo Romero Date: Wed, 12 Nov 2025 00:33:40 +0100 Subject: execute.c: Report exception also on repeated callback So far, exceptions coming from the pc callback were only being reported on its first call. However, pc callbacks might assign a continuation callback if the operation cannot be completed on a single call. --- src/interp/routines/execute.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/interp/routines/execute.c b/src/interp/routines/execute.c index fe1e8d7..d04363e 100644 --- a/src/interp/routines/execute.c +++ b/src/interp/routines/execute.c @@ -33,7 +33,17 @@ static enum nw_state repeat(struct nw_interp *const i) struct nw_next *const next = &b->next; const enum nw_state n = next->fn(next->user, next); - if (n) + if (n == NW_FATAL) + { + static const char *const exc = "pc callback failed"; + + i->exception = exc; +#ifdef NW_LOG + nwp_log("%s, pc: %ld\n", exc, b->pc); +#endif + return NW_FATAL; + } + else if (n) return n; return execute(i); -- cgit v1.2.3