summaryrefslogtreecommitdiff
path: root/third_party/llvm-project/dwarf2yaml.cpp
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2020-01-27 14:24:08 -0800
committerGitHub <noreply@github.com>2020-01-27 14:24:08 -0800
commit79fdd327c239597207e8313c6bf83a846917ebc2 (patch)
treed909e9d09bfd3071ba107c676f2254469552231c /third_party/llvm-project/dwarf2yaml.cpp
parentde18d960d51810d71b5f2fa812c21a991924f00c (diff)
downloadbinaryen-79fdd327c239597207e8313c6bf83a846917ebc2.tar.gz
binaryen-79fdd327c239597207e8313c6bf83a846917ebc2.tar.bz2
binaryen-79fdd327c239597207e8313c6bf83a846917ebc2.zip
DWARF: Fix emitting of DW_FORM_sdata (#2627)
Diffstat (limited to 'third_party/llvm-project/dwarf2yaml.cpp')
-rw-r--r--third_party/llvm-project/dwarf2yaml.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/third_party/llvm-project/dwarf2yaml.cpp b/third_party/llvm-project/dwarf2yaml.cpp
index 994be5511..b43b0e420 100644
--- a/third_party/llvm-project/dwarf2yaml.cpp
+++ b/third_party/llvm-project/dwarf2yaml.cpp
@@ -235,13 +235,18 @@ void dumpDebugInfo(DWARFContext &DCtx, DWARFYAML::Data &Y) {
case dwarf::DW_FORM_data2:
case dwarf::DW_FORM_data4:
case dwarf::DW_FORM_data8:
- case dwarf::DW_FORM_sdata:
case dwarf::DW_FORM_udata:
case dwarf::DW_FORM_ref_sup4:
case dwarf::DW_FORM_ref_sup8:
if (auto Val = FormValue.getValue().getAsUnsignedConstant())
NewValue.Value = Val.getValue();
break;
+ // XXX BINARYEN: sdata is signed, and FormValue won't return it as
+ // unsigned (it returns an empty value).
+ case dwarf::DW_FORM_sdata:
+ if (auto Val = FormValue.getValue().getAsSignedConstant())
+ NewValue.Value = Val.getValue();
+ break;
case dwarf::DW_FORM_string:
if (auto Val = FormValue.getValue().getAsCString())
NewValue.CStr = Val.getValue();