[wasm-shape] Print module instantiation error

This commit is contained in:
Behdad Esfahbod 2023-02-26 12:18:31 -07:00
parent 7e397d8695
commit 142ceaf246
1 changed files with 6 additions and 4 deletions

View File

@ -133,6 +133,8 @@ static hb_wasm_shape_plan_t *
acquire_shape_plan (hb_face_t *face,
const hb_wasm_face_data_t *face_data)
{
char error[128];
/* Fetch cached one if available. */
hb_wasm_shape_plan_t *plan = face_data->plan.get_acquire ();
if (likely (plan && face_data->plan.cmpexch (plan, nullptr)))
@ -148,10 +150,10 @@ acquire_shape_plan (hb_face_t *face,
module_inst = plan->module_inst = wasm_runtime_instantiate (face_data->wasm_module,
stack_size, heap_size,
nullptr, 0);
error, sizeof (error));
if (unlikely (!module_inst))
{
DEBUG_MSG (WASM, face_data, "Create wasm module instance failed.");
DEBUG_MSG (WASM, face_data, "Create wasm module instance failed: %s", error);
goto fail;
}