From 18f901125ad1b97ee3f79cb2f5d87704b52191ee Mon Sep 17 00:00:00 2001 From: Xavier Del Campo Romero Date: Sun, 9 Nov 2025 20:02:30 +0100 Subject: call_import.c: Always set ci->pc Otherwise, imports without parameters would jump to `call` directly without assigning ci->pc first, so that nwp_interp_resume would read incorrectly from offset 0. --- src/routines/call_import.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/routines/call_import.c b/src/routines/call_import.c index 63a736e..6a94ff0 100644 --- a/src/routines/call_import.c +++ b/src/routines/call_import.c @@ -403,7 +403,7 @@ static enum nw_state tell(struct nw_interp *const i) if (n) return n; - i->next = seek_param_types; + i->next = ci->fn.param_count ? seek_param_types : call; return NW_AGAIN; } @@ -465,7 +465,7 @@ static enum nw_state prepare(struct nw_interp *const i) *pci = ci; pci->fn = fn; pci->imp = imp; - i->next = pci->fn.param_count ? tell : call; + i->next = tell; } return NW_AGAIN; -- cgit v1.2.3