Skip to content

Commit e860e32

Browse files
committed
webassembly/objjsproxy: Fix proxying in arguments to JS new function.
Signed-off-by: Damien George <[email protected]>
1 parent 50b43fe commit e860e32

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ports/webassembly/objjsproxy.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ EM_JS(void, js_reflect_construct, (int f_ref, uint32_t n_args, uint32_t * args,
147147
const f = proxy_js_ref[f_ref];
148148
const as = [];
149149
for (let i = 0; i < n_args; ++i) {
150-
as.push(proxy_convert_mp_to_js_obj_jsside(args + i * 4));
150+
as.push(proxy_convert_mp_to_js_obj_jsside(args + i * 3 * 4));
151151
}
152152
const ret = Reflect.construct(f, as);
153153
proxy_convert_js_to_mp_obj_jsside(ret, out);
@@ -242,7 +242,7 @@ static mp_obj_t jsproxy_reflect_construct(size_t n_args, const mp_obj_t *args) {
242242
for (unsigned int i = 0; i < n_args; ++i) {
243243
proxy_convert_mp_to_js_obj_cside(args[i], &args_conv[i * PVN]);
244244
}
245-
uint32_t out[3];
245+
uint32_t out[PVN];
246246
js_reflect_construct(arg0, n_args, args_conv, out);
247247
return proxy_convert_js_to_mp_obj_cside(out);
248248
}

0 commit comments

Comments
 (0)