Skip to content

Commit

Permalink
Fix incorrect form test in SymbolFileDWARF
Browse files Browse the repository at this point in the history
Summary:
We were checking whether an attribute is in block form by getting the block data pointer, which
was not correct as the pointer be null even if the attribute is in block form. Other places in
the file already use the correct test.

To make this work, I've needed to add DW_FORM_exprlock to the list of "block" forms, which seems
correct as that is how we are parsing it.

Reviewers: clayborg

Subscribers: lldb-commits

Differential Revision: https://reviews.llvm.org/D22756

llvm-svn: 276735
  • Loading branch information
labath committed Jul 26, 2016
1 parent f7e7fdd commit 57d0535
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp
Expand Up @@ -556,6 +556,7 @@ DWARFFormValue::IsBlockForm(const dw_form_t form)
{
switch (form)
{
case DW_FORM_exprloc:
case DW_FORM_block:
case DW_FORM_block1:
case DW_FORM_block2:
Expand Down
2 changes: 1 addition & 1 deletion lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
Expand Up @@ -4292,7 +4292,7 @@ SymbolFileDWARF::ParseVariableDIE
{
location_is_const_value_data = false;
has_explicit_location = true;
if (form_value.BlockData())
if (DWARFFormValue::IsBlockForm(form_value.Form()))
{
const DWARFDataExtractor& debug_info_data = get_debug_info_data();

Expand Down

0 comments on commit 57d0535

Please sign in to comment.