From b6216a5f8a5a6a6b7c516a5ad414c43ce904f400 Mon Sep 17 00:00:00 2001 From: Wenyong Huang Date: Mon, 11 Mar 2024 18:11:43 +0800 Subject: [PATCH] Fix ip (bytecode offset) not committed into the latest aot frame (#3213) --- core/iwasm/compilation/aot_emit_exception.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/core/iwasm/compilation/aot_emit_exception.c b/core/iwasm/compilation/aot_emit_exception.c index 1e4cccbe68..d3dcf719db 100644 --- a/core/iwasm/compilation/aot_emit_exception.c +++ b/core/iwasm/compilation/aot_emit_exception.c @@ -88,6 +88,12 @@ aot_emit_exception(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx, aot_set_last_error("llvm build phi failed."); return false; } + + /* Commit ip to current frame */ + if (!commit_ip(comp_ctx, func_ctx, func_ctx->exception_ip_phi, + is_64bit)) { + return false; + } } /* Call aot_set_exception_with_id() to throw exception */ @@ -154,12 +160,6 @@ aot_emit_exception(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx, return false; } - if (comp_ctx->aot_frame) { - if (!commit_ip(comp_ctx, func_ctx, func_ctx->exception_ip_phi, - is_64bit)) - return false; - } - /* Create return IR */ AOTFuncType *aot_func_type = func_ctx->aot_func->func_type; if (!aot_build_zero_function_ret(comp_ctx, func_ctx, aot_func_type)) {