|
|
@@ -1934,8 +1934,8 @@ wasm_frame_vec_clone_internal(Vector *src, Vector *out)
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- bh_memcpy_s(out->data, src->num_elems * sizeof(WASMCApiFrame), src->data,
|
|
|
- src->num_elems * sizeof(WASMCApiFrame));
|
|
|
+ bh_memcpy_s(out->data, (uint32)(src->num_elems * sizeof(WASMCApiFrame)),
|
|
|
+ src->data, (uint32)(src->num_elems * sizeof(WASMCApiFrame)));
|
|
|
out->num_elems = src->num_elems;
|
|
|
}
|
|
|
|
|
|
@@ -2962,8 +2962,10 @@ wasm_func_new_basic(wasm_store_t *store, const wasm_functype_t *type,
|
|
|
if (!(func->type = wasm_functype_copy(type))) {
|
|
|
goto failed;
|
|
|
}
|
|
|
- func->param_count = func->type->params->num_elems;
|
|
|
- func->result_count = func->type->results->num_elems;
|
|
|
+ /* func type's param_count and result_count were checked in
|
|
|
+ loader and are no larger than UINT16_MAX */
|
|
|
+ func->param_count = (uint16)func->type->params->num_elems;
|
|
|
+ func->result_count = (uint16)func->type->results->num_elems;
|
|
|
|
|
|
RETURN_OBJ(func, wasm_func_delete)
|
|
|
}
|
|
|
@@ -2994,8 +2996,10 @@ wasm_func_new_with_env_basic(wasm_store_t *store, const wasm_functype_t *type,
|
|
|
if (!(func->type = wasm_functype_copy(type))) {
|
|
|
goto failed;
|
|
|
}
|
|
|
- func->param_count = func->type->params->num_elems;
|
|
|
- func->result_count = func->type->results->num_elems;
|
|
|
+ /* func type's param_count and result_count were checked in
|
|
|
+ loader and are no larger than UINT16_MAX */
|
|
|
+ func->param_count = (uint16)func->type->params->num_elems;
|
|
|
+ func->result_count = (uint16)func->type->results->num_elems;
|
|
|
|
|
|
RETURN_OBJ(func, wasm_func_delete)
|
|
|
}
|
|
|
@@ -3085,8 +3089,10 @@ wasm_func_new_internal(wasm_store_t *store, uint16 func_idx_rt,
|
|
|
if (!func->type) {
|
|
|
goto failed;
|
|
|
}
|
|
|
- func->param_count = func->type->params->num_elems;
|
|
|
- func->result_count = func->type->results->num_elems;
|
|
|
+ /* func type's param_count and result_count were checked in
|
|
|
+ loader and are no larger than UINT16_MAX */
|
|
|
+ func->param_count = (uint16)func->type->params->num_elems;
|
|
|
+ func->result_count = (uint16)func->type->results->num_elems;
|
|
|
|
|
|
/* will add name information when processing "exports" */
|
|
|
func->store = store;
|