[Lldb-commits] [lldb] 40b2c7f - [lldb] Fix another instance where we pass a nullptr as TypeSourceInfo to NonTypeTemplateParmDecl::Create
Raphael Isemann via lldb-commits
lldb-commits at lists.llvm.org
Tue Feb 18 04:25:49 PST 2020
Author: Raphael Isemann
Date: 2020-02-18T13:25:31+01:00
New Revision: 40b2c7f29b44e3c3e171a04593ac650aaf7c6ae6
URL: https://github.com/llvm/llvm-project/commit/40b2c7f29b44e3c3e171a04593ac650aaf7c6ae6
DIFF: https://github.com/llvm/llvm-project/commit/40b2c7f29b44e3c3e171a04593ac650aaf7c6ae6.diff
LOG: [lldb] Fix another instance where we pass a nullptr as TypeSourceInfo to NonTypeTemplateParmDecl::Create
Summary:
Follow up to an issue pointed out in the review of D73808. We shouldn't just pass in a nullptr TypeSourceInfo
in case Clang decided to access it.
Reviewers: shafik, vsk
Reviewed By: shafik, vsk
Subscribers: kristof.beyls, JDevlieghere, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D73946
Added:
Modified:
lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
Removed:
################################################################################
diff --git a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
index 275911a76fb6..4092dc6ff78f 100644
--- a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
+++ b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
@@ -1298,11 +1298,13 @@ static TemplateParameterList *CreateTemplateParameterList(
if (!template_param_infos.packed_args->args.empty() &&
IsValueParam(template_param_infos.packed_args->args[0])) {
+ QualType template_param_type =
+ template_param_infos.packed_args->args[0].getIntegralType();
template_param_decls.push_back(NonTypeTemplateParmDecl::Create(
ast, decl_context, SourceLocation(), SourceLocation(), depth,
- num_template_params, identifier_info,
- template_param_infos.packed_args->args[0].getIntegralType(),
- parameter_pack_true, nullptr));
+ num_template_params, identifier_info, template_param_type,
+ parameter_pack_true,
+ ast.getTrivialTypeSourceInfo(template_param_type)));
} else {
template_param_decls.push_back(TemplateTypeParmDecl::Create(
ast, decl_context, SourceLocation(), SourceLocation(), depth,
More information about the lldb-commits
mailing list