aot debug: Fix a few NULL dereferences on errors (#3273)

This commit is contained in:
YAMAMOTO Takashi
2024-04-02 15:30:08 +09:00
committed by GitHub
parent 250829c0cc
commit 6b0b5de1c5
3 changed files with 11 additions and 3 deletions

View File

@ -966,7 +966,9 @@ aot_compile_func(AOTCompContext *comp_ctx, uint32 func_index)
location = dwarf_gen_location(
comp_ctx, func_ctx,
(frame_ip - 1) - comp_ctx->comp_data->wasm_module->buf_code);
LLVMSetCurrentDebugLocation2(comp_ctx->builder, location);
if (location != NULL) {
LLVMSetCurrentDebugLocation2(comp_ctx->builder, location);
}
#endif
switch (opcode) {