Fix out of bounds access in complete.d when there is no paren. (#754)
This commit is contained in:
parent
8a693954d3
commit
dc11cf704d
|
@ -361,7 +361,12 @@ CalltipHint getCalltipHint(T)(T beforeTokens, out size_t parenIndex)
|
||||||
// evaluate at comma case
|
// evaluate at comma case
|
||||||
if (beforeTokens.isComma)
|
if (beforeTokens.isComma)
|
||||||
{
|
{
|
||||||
parenIndex = beforeTokens.goBackToOpenParen;
|
size_t tmp = beforeTokens.goBackToOpenParen;
|
||||||
|
if(tmp == size_t.max){
|
||||||
|
return CalltipHint.regularArguments;
|
||||||
|
}
|
||||||
|
parenIndex = tmp;
|
||||||
|
|
||||||
// check if we are actually a "!("
|
// check if we are actually a "!("
|
||||||
if (beforeTokens[0 .. parenIndex].isTemplateBangParen)
|
if (beforeTokens[0 .. parenIndex].isTemplateBangParen)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue