This is an archive of the discontinued LLVM Phabricator instance.

Initialize SubArch in class Triple
ClosedPublic

Authored by krytarowski on Jun 2 2017, 11:24 AM.

Details

Summary

LLDB built with asan on NetBSD detected issues in the following code:

void ArchSpec::Clear() {
  m_triple = llvm::Triple();
  m_core = kCore_invalid;
  m_byte_order = eByteOrderInvalid;
  m_distribution_id.Clear();
  m_flags = 0;
}
  • lldb/source/Core/ArchSpec.cpp

Runtime error messages:

/public/pkgsrc-tmp/wip/lldb-netbsd/work/.buildlink/include/llvm/ADT/Triple.h:44:7: runtime error: load of value 32639, which is not a valid value for type 'SubArchType'
/public/pkgsrc-tmp/wip/lldb-netbsd/work/.buildlink/include/llvm/ADT/Triple.h:44:7: runtime error: load of value 3200171710, which is not a valid value for type 'SubArchType'
/public/pkgsrc-tmp/wip/lldb-netbsd/work/.buildlink/include/llvm/ADT/Triple.h:44:7: runtime error: load of value 3200171710, which is not a valid value for type 'SubArchType'

Correct this issue with initialization of SubArch() in the class Triple constructor.

Sponsored by <The NetBSD Foundation>

Diff Detail

Repository
rL LLVM

Event Timeline

krytarowski created this revision.Jun 2 2017, 11:24 AM
zturner accepted this revision.Jun 11 2017, 5:22 PM
This revision is now accepted and ready to land.Jun 11 2017, 5:22 PM
krytarowski closed this revision.Jun 11 2017, 5:28 PM