summaryrefslogtreecommitdiffstats
path: root/lldb/source/API
diff options
context:
space:
mode:
authorPavel Labath <labath@google.com>2017-11-30 10:16:54 +0000
committerPavel Labath <labath@google.com>2017-11-30 10:16:54 +0000
commitf59056ff93e874b9dde711a26745b648c4d88bab (patch)
treefb1064bbcd97a623fc1a039bafa63ee5e78c0e42 /lldb/source/API
parentda34247a6aac509f994c57b727a60daf23023e29 (diff)
downloadbcm5719-llvm-f59056ff93e874b9dde711a26745b648c4d88bab.tar.gz
bcm5719-llvm-f59056ff93e874b9dde711a26745b648c4d88bab.zip
Fix assertion in ClangASTContext
Summary: llvm::APSInt(0) asserts because it creates an int with bit-width 0 and not (as I thought) a value 0. Theoretically it should be sufficient to change this to APSInt(1), as the intention there was that the value of the first argument should be ignored if the type is invalid, but that would look dodgy. Instead, I use llvm::Optional to denote an invalid value and use a special struct instead of a std::pair, to reduce typing and increase clarity. Reviewers: clayborg Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D40615 llvm-svn: 319414
Diffstat (limited to 'lldb/source/API')
-rw-r--r--lldb/source/API/SBType.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lldb/source/API/SBType.cpp b/lldb/source/API/SBType.cpp
index b0357da5c57..80d48754c89 100644
--- a/lldb/source/API/SBType.cpp
+++ b/lldb/source/API/SBType.cpp
@@ -426,7 +426,7 @@ lldb::SBType SBType::GetTemplateArgumentType(uint32_t idx) {
case eTemplateArgumentKindIntegral:
type = m_opaque_sp->GetCompilerType(false)
.GetIntegralTemplateArgument(idx)
- .second;
+ ->type;
break;
default:
break;
OpenPOWER on IntegriCloud