fix: Crash when has source line like "std::cout << (3+4*4>5*(4+3)-1 && (4-3>5)) <<std::endl;".

This commit is contained in:
Roy Qu 2024-05-04 12:33:35 +08:00
parent 49049b0884
commit ce97272fc0
2 changed files with 7 additions and 2 deletions

View File

@ -159,6 +159,7 @@ Red Panda C++ Version 2.27
- fix: In options -> code format -> Program, Choose astyle path button doesn't work.
- fix: project not correctly reparsed after rename unit.
- enhancement: support C++ 17 structured binding in stl map containers foreach loop.
- fix: Crash when has source line like "std::cout << (3+4*4>5*(4+3)-1 && (4-3>5)) <<std::endl;";
Red Panda C++ Version 2.26
- enhancement: Code suggestion for embedded std::vectors.

View File

@ -4240,6 +4240,10 @@ void CppParser::handleVar(const QString& typePrefix,bool isExtern,bool isStatic,
tempType+=mTokenizer[mIndex]->text;
mIndex++;
break;
case ',':
tempType="";
mIndex++;
break;
case '(':
if (mTokenizer[mIndex]->matchIndex+1<maxIndex
&& mTokenizer[mTokenizer[mIndex]->matchIndex+1]->text=='(') {
@ -4361,8 +4365,8 @@ void CppParser::handleVar(const QString& typePrefix,bool isExtern,bool isStatic,
}
mIndex++;
} else {
tempType="";
mIndex++;
mIndex = indexOfNextPeriodOrSemicolon(mIndex, maxIndex);
return;
}
}
}