diff options
author | Martin Pieuchot <mpi@cvs.openbsd.org> | 2019-11-07 13:36:04 +0000 |
---|---|---|
committer | Martin Pieuchot <mpi@cvs.openbsd.org> | 2019-11-07 13:36:04 +0000 |
commit | b87454b461e623030df29af565243fa1f0c70e00 (patch) | |
tree | d67c016b8be8cf3b0b12c48560b194d6c3e3d3b7 /usr.bin | |
parent | b3f189e0ccc9a6a7e5a6a61ac3e486a16e04ece9 (diff) |
Stop remembering the type of local variables.
Fix a shadowing issue reported by procter@.
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/ctfconv/parse.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/usr.bin/ctfconv/parse.c b/usr.bin/ctfconv/parse.c index 7b839330d0f..0d1ee731ab6 100644 --- a/usr.bin/ctfconv/parse.c +++ b/usr.bin/ctfconv/parse.c @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.c,v 1.11 2018/01/31 14:47:13 mpi Exp $ */ +/* $OpenBSD: parse.c,v 1.12 2019/11/07 13:36:03 mpi Exp $ */ /* * Copyright (c) 2016-2017 Martin Pieuchot @@ -1263,7 +1263,7 @@ parse_variable(struct dwdie *die, size_t psz) struct dwaval *dav; const char *name = NULL; size_t ref = 0; - int forward = 0; + int forward = 0, global = 0; SIMPLEQ_FOREACH(dav, &die->die_avals, dav_next) { switch (dav->dav_dat->dat_attr) { @@ -1276,6 +1276,18 @@ parse_variable(struct dwdie *die, size_t psz) case DW_AT_type: ref = dav2val(dav, psz); break; + case DW_AT_location: + switch (dav->dav_dat->dat_form) { + case DW_FORM_block: + case DW_FORM_block1: + case DW_FORM_block2: + case DW_FORM_block4: + global = 1; + break; + default: + break; + } + break; default: DPRINTF("%s\n", dw_at2name(dav->dav_dat->dat_attr)); break; @@ -1283,7 +1295,7 @@ parse_variable(struct dwdie *die, size_t psz) } - if (!forward && name != NULL) { + if (global && !forward && name != NULL) { it = it_new(++oidx, die->die_offset, name, 0, 0, ref, 0, ITF_UNRES|ITF_OBJ); } |