- fix: crash when source files contains macro definitions like "#define cfun (cfun + 0)"
This commit is contained in:
parent
88b592f829
commit
58b92a6360
1
NEWS.md
1
NEWS.md
|
@ -19,6 +19,7 @@ Red Panda C++ Version 2.23
|
||||||
- enhancement: correctly highlight multiline raw string literals.
|
- enhancement: correctly highlight multiline raw string literals.
|
||||||
- change: remove "Assembly" color scheme item (it's not used anymore).
|
- change: remove "Assembly" color scheme item (it's not used anymore).
|
||||||
- fix: crash when parsing files containing inline assembly code.
|
- fix: crash when parsing files containing inline assembly code.
|
||||||
|
- fix: crash when source files contains macro definitions like "#define cfun (cfun + 0)"
|
||||||
|
|
||||||
Red Panda C++ Version 2.22
|
Red Panda C++ Version 2.22
|
||||||
|
|
||||||
|
|
|
@ -5068,6 +5068,13 @@ bool CppParser::expandMacro(QStringList &phraseExpression, int &pos, const PStat
|
||||||
case QSynedit::TokenType::Space:
|
case QSynedit::TokenType::Space:
|
||||||
case QSynedit::TokenType::Comment:
|
case QSynedit::TokenType::Comment:
|
||||||
break;
|
break;
|
||||||
|
case QSynedit::TokenType::Identifier:
|
||||||
|
if (token!=macro->command)
|
||||||
|
phraseExpression.insert(pos+i,token);
|
||||||
|
else
|
||||||
|
phraseExpression.insert(pos+i,token+"_expanded");
|
||||||
|
i++;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
phraseExpression.insert(pos+i,token);
|
phraseExpression.insert(pos+i,token);
|
||||||
i++;
|
i++;
|
||||||
|
|
Loading…
Reference in New Issue