Commit 99dea548 authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Orgad Shaneh
Browse files

C++: Fix crash in template argument resolving



Occurs in boost/phoenix.hpp

Task-number: QTCREATORBUG-14748
Change-Id: If89b0db48346aac72e0d8aaa8d165b2bf43bd784
Reviewed-by: default avatarNikolai Kosjar <nikolai.kosjar@theqtcompany.com>
parent fff0a271
......@@ -214,7 +214,7 @@ unsigned SymbolTable::symbolCount() const
Symbol *SymbolTable::symbolAt(unsigned index) const
{
if (! _symbols)
if (! _symbols || index >= symbolCount())
return 0;
return _symbols[index];
}
......
......@@ -1971,8 +1971,9 @@ FullySpecifiedType CreateBindings::resolveTemplateArgument(Clone &cloner,
{
FullySpecifiedType ty;
const TypenameArgument *tParam
= specialization->templateParameterAt(index)->asTypenameArgument();
const TypenameArgument *tParam = 0;
if (Symbol *tArgument = specialization->templateParameterAt(index))
tParam = tArgument->asTypenameArgument();
if (!tParam)
return ty;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment