mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-25 03:12:56 +00:00
fix infinite loop in normalizeTypeInternal() function
Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
This commit is contained in:
parent
6393759d3f
commit
e6676a2497
1 changed files with 6 additions and 9 deletions
|
@ -193,18 +193,15 @@ static inline QByteArray normalizeTypeInternal(const char *t, const char *e)
|
||||||
'char * const *' into 'const char **' and we must beware of
|
'char * const *' into 'const char **' and we must beware of
|
||||||
'Bar<const Bla>'.
|
'Bar<const Bla>'.
|
||||||
*/
|
*/
|
||||||
int searchindex = 1;
|
int searchindex = result.indexOf(" const", 1);
|
||||||
while (searchindex > 0) {
|
while (searchindex > 0) {
|
||||||
searchindex = result.indexOf(" const", searchindex);
|
if (result.at(searchindex - 1) != '*') {
|
||||||
if (searchindex > 1) {
|
result.remove(searchindex, 6);
|
||||||
char prevchar = result.at(searchindex - 1);
|
if (!result.startsWith("const ")) {
|
||||||
if (prevchar != '*') {
|
result.prepend("const ");
|
||||||
result.remove(searchindex, 6);
|
|
||||||
if (!result.startsWith("const ")) {
|
|
||||||
result.prepend("const ");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
searchindex = result.indexOf(" const", searchindex + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// convert const reference to value and const value to value
|
// convert const reference to value and const value to value
|
||||||
|
|
Loading…
Add table
Reference in a new issue