diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/routines/call_import.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/routines/call_import.c b/src/routines/call_import.c index 6a94ff0..38e0338 100644 --- a/src/routines/call_import.c +++ b/src/routines/call_import.c @@ -151,18 +151,20 @@ static enum nw_state call_done(struct nw_interp *const i) const nw_varuint32 pcnt = fn->param_count; const struct nw_interp_cfg *const icfg = &i->cfg; union nw_value *const ret = fn->ret.count ? icfg->args + pcnt : NULL; + struct nw_return r = {0}; if (ret) { size_t sz; + const enum nw_type type = fn->ret.type; - if (nwp_type_sz(fn->ret.type, &sz)) + if (nwp_type_sz(type, &sz)) { static const char *const exc = "invalid return type"; i->exception = exc; #ifdef NW_LOG - nwp_log("%s: %#x\n", exc, (unsigned)fn->ret.type); + nwp_log("%s: %#x\n", exc, (unsigned)type); #endif return NW_FATAL; } @@ -175,10 +177,14 @@ static enum nw_state call_done(struct nw_interp *const i) ci->io = io; i->next = push_return; } + + r.count = 1; + r.type = type; } else nwp_interp_resume(i); + i->fr.prev_ret = r; return NW_AGAIN; } |
