From 142ceaf2466b66fc868f125b4adc6e727b981f3b Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sun, 26 Feb 2023 12:18:31 -0700 Subject: [PATCH] [wasm-shape] Print module instantiation error --- src/hb-wasm-shape.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/hb-wasm-shape.cc b/src/hb-wasm-shape.cc index 5ad1b483a..439de4704 100644 --- a/src/hb-wasm-shape.cc +++ b/src/hb-wasm-shape.cc @@ -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))) @@ -146,12 +148,12 @@ acquire_shape_plan (hb_face_t *face, constexpr uint32_t stack_size = 32 * 1024, heap_size = 2 * 1024 * 1024; - module_inst = plan->module_inst = wasm_runtime_instantiate(face_data->wasm_module, - stack_size, heap_size, - nullptr, 0); + module_inst = plan->module_inst = wasm_runtime_instantiate (face_data->wasm_module, + stack_size, heap_size, + 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; }