From 0df05aff1a16665137a9d50cd862931358b73ea7 Mon Sep 17 00:00:00 2001 From: Alix ANNERAUD Date: Mon, 17 Mar 2025 22:48:00 +0100 Subject: [PATCH] fix: simplify instruction limit checks for better readability --- core/iwasm/interpreter/wasm_interp_classic.c | 2 +- core/iwasm/interpreter/wasm_interp_fast.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/core/iwasm/interpreter/wasm_interp_classic.c b/core/iwasm/interpreter/wasm_interp_classic.c index 94fa72c0c..97c1bb0de 100644 --- a/core/iwasm/interpreter/wasm_interp_classic.c +++ b/core/iwasm/interpreter/wasm_interp_classic.c @@ -1575,7 +1575,7 @@ get_global_addr(uint8 *global_data, WASMGlobalInstance *global) goto got_exception; \ } \ else if (instructions_left > 0) \ - instructions_left--; \ + instructions_left--; #else #define CHECK_INSTRUCTION_LIMIT() (void)0 #endif diff --git a/core/iwasm/interpreter/wasm_interp_fast.c b/core/iwasm/interpreter/wasm_interp_fast.c index 676e4e74b..af92c82e2 100644 --- a/core/iwasm/interpreter/wasm_interp_fast.c +++ b/core/iwasm/interpreter/wasm_interp_fast.c @@ -107,9 +107,9 @@ typedef float64 CellType_F64; wasm_set_exception(module_inst, "instruction limit exceeded"); \ goto got_exception; \ } \ - else if (instructions_left > 0) { \ - instructions_left--; \ - } \ + else if (instructions_left > 0) \ + instructions_left--; + #else #define CHECK_INSTRUCTION_LIMIT() (void)0 #endif