]> granicus.if.org Git - llvm/commit
Initialize SubArch in class Triple
authorKamil Rytarowski <n54@gmx.com>
Mon, 12 Jun 2017 00:28:14 +0000 (00:28 +0000)
committerKamil Rytarowski <n54@gmx.com>
Mon, 12 Jun 2017 00:28:14 +0000 (00:28 +0000)
commitc034fe3bb56f21d47540cde9dac7cdf6d525909f
tree80744155fdac8b38f329918b4ce298723b7093b3
parent108ba469427ce88aa5f015f8ba6b4a6e98e4d1f0
Initialize SubArch in class Triple

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>

Reviewers: chandlerc, zturner

Reviewed By: zturner

Subscribers: llvm-commits, zturner

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305178 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/ADT/Triple.h