From e37ff84eff7d9ecdc5409ef9cbf884d3a42b1b05 Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Sun, 18 Feb 2007 12:15:37 +0100 Subject: [PATCH] dbghelp: Return when not finding the name. --- dlls/dbghelp/dwarf.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/dlls/dbghelp/dwarf.c b/dlls/dbghelp/dwarf.c index 6ff33f26d6f..75d545a1eea 100644 --- a/dlls/dbghelp/dwarf.c +++ b/dlls/dbghelp/dwarf.c @@ -1203,7 +1203,7 @@ static void dwarf2_parse_enumerator(dwarf2_parse_context_t* ctx, TRACE("%s, for %s\n", dwarf2_debug_ctx(ctx), dwarf2_debug_di(di)); - if (!dwarf2_find_attribute(ctx, di, DW_AT_name, &name)) name.u.string = NULL; + if (!dwarf2_find_attribute(ctx, di, DW_AT_name, &name)) return; if (!dwarf2_find_attribute(ctx, di, DW_AT_const_value, &value)) value.u.svalue = 0; symt_add_enum_element(ctx->module, parent, name.u.string, value.u.svalue); @@ -1278,8 +1278,10 @@ static void dwarf2_parse_variable(dwarf2_subprogram_t* subpgm, is_pmt = !block && di->abbrev->tag == DW_TAG_formal_parameter; param_type = dwarf2_lookup_type(subpgm->ctx, di); - if (!dwarf2_find_attribute(subpgm->ctx, di, DW_AT_name, &name)) - name.u.string = NULL; + if (!dwarf2_find_attribute(subpgm->ctx, di, DW_AT_name, &name)) { + /* cannot do much without the name, the functions below won't like it. */ + return; + } if (dwarf2_compute_location_attr(subpgm->ctx, di, DW_AT_location, &loc, &subpgm->frame)) {