- fix: Crash if there's no period/semicolon after variable definition with intializer.

This commit is contained in:
Roy Qu 2024-09-11 15:30:04 +08:00
parent c796208840
commit 1a95f59ddd
1 changed files with 3 additions and 0 deletions

View File

@ -4327,6 +4327,9 @@ void CppParser::handleVar(const QString& typePrefix,bool isExtern,bool isStatic,
} }
mIndex=mTokenizer[mIndex]->matchIndex+1; mIndex=mTokenizer[mIndex]->matchIndex+1;
addedVar.reset(); addedVar.reset();
//If there are multiple var define in the same line, the next token should be ','
if (mIndex>=maxIndex || mTokenizer[mIndex]->text != ",")
return;
break; break;
default: default:
if (isIdentChar(mTokenizer[mIndex]->text[0])) { if (isIdentChar(mTokenizer[mIndex]->text[0])) {