type_linear_member_lookup(type, i, &two);
WasmType wt = onyx_type_to_wasm_type(two.type);
- temp_locals[i] = local_raw_allocate(mod->local_alloc, wt);
- WIL(NULL, WI_LOCAL_SET, temp_locals[i]);
+ if (wt != WASM_TYPE_VOID) {
+ temp_locals[i] = local_raw_allocate(mod->local_alloc, wt);
+ WIL(NULL, WI_LOCAL_SET, temp_locals[i]);
+ }
}
if (!location_first) WIL(NULL, WI_LOCAL_SET, loc_idx);
fori (i, 0, elem_count) {
type_linear_member_lookup(type, i, &two);
- u64 tmp_idx = temp_locals[i];
- WIL(NULL, WI_LOCAL_GET, loc_idx);
- WIL(NULL, WI_LOCAL_GET, tmp_idx);
- emit_store_instruction(mod, &code, two.type, offset + two.offset);
-
WasmType wt = onyx_type_to_wasm_type(two.type);
- local_raw_free(mod->local_alloc, wt);
+ if (wt != WASM_TYPE_VOID) {
+ u64 tmp_idx = temp_locals[i];
+ WIL(NULL, WI_LOCAL_GET, loc_idx);
+ WIL(NULL, WI_LOCAL_GET, tmp_idx);
+ emit_store_instruction(mod, &code, two.type, offset + two.offset);
+
+ local_raw_free(mod->local_alloc, wt);
+ }
}
local_raw_free(mod->local_alloc, WASM_TYPE_PTR);