From ed152e847aeddd278175153c6b219b99f6c351d6 Mon Sep 17 00:00:00 2001 From: Stefan Wallentowitz Date: Mon, 22 Jul 2024 18:33:15 +0200 Subject: [PATCH] execute_func: Newline only for non-empty returns For void functions, the return value array is empty. Don't print the newline then. --- core/iwasm/common/wasm_application.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/iwasm/common/wasm_application.c b/core/iwasm/common/wasm_application.c index 3b3be16c0..88f9d86f6 100644 --- a/core/iwasm/common/wasm_application.c +++ b/core/iwasm/common/wasm_application.c @@ -874,7 +874,9 @@ execute_func(WASMModuleInstanceCommon *module_inst, const char *name, if (j < (uint32)(type->result_count - 1)) os_printf(","); } - os_printf("\n"); + if (type->result_count > 0) { + os_printf("\n"); + } #if WASM_ENABLE_GC != 0 for (j = 0; j < num_local_ref_pushed; j++) {