From 61c8728a6eb7da6bf632be434e5a386c835ef127 Mon Sep 17 00:00:00 2001 From: Eric Pouech Date: Mon, 15 Nov 2021 18:26:08 +0100 Subject: [PATCH] dbghelp/dwarf: Don't register labels without address. Signed-off-by: Eric Pouech Signed-off-by: Alexandre Julliard --- dlls/dbghelp/dwarf.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/dlls/dbghelp/dwarf.c b/dlls/dbghelp/dwarf.c index 7b925ee53b8..d6b8de7400a 100644 --- a/dlls/dbghelp/dwarf.c +++ b/dlls/dbghelp/dwarf.c @@ -2065,14 +2065,18 @@ static void dwarf2_parse_subprogram_label(dwarf2_subprogram_t* subpgm, TRACE("%s\n", dwarf2_debug_di(di)); - if (!dwarf2_find_attribute(di, DW_AT_low_pc, &low_pc)) low_pc.u.uvalue = 0; if (!dwarf2_find_attribute(di, DW_AT_name, &name)) name.u.string = NULL; - - loc.kind = loc_absolute; - loc.offset = subpgm->ctx->module_ctx->load_offset + low_pc.u.uvalue - subpgm->top_func->address; - symt_add_function_point(subpgm->ctx->module_ctx->module, subpgm->top_func, SymTagLabel, - &loc, name.u.string); + if (dwarf2_find_attribute(di, DW_AT_low_pc, &low_pc)) + { + loc.kind = loc_absolute; + loc.offset = subpgm->ctx->module_ctx->load_offset + low_pc.u.uvalue - subpgm->top_func->address; + symt_add_function_point(subpgm->ctx->module_ctx->module, subpgm->top_func, SymTagLabel, + &loc, name.u.string); + } + else + WARN("Label %s inside function %s doesn't have an address... don't register it\n", + name.u.string, subpgm->top_func->hash_elt.name); } static void dwarf2_parse_subprogram_block(dwarf2_subprogram_t* subpgm,