Report error in the buffer formatter if a recursive struct is declared

This commit is contained in:
baldurk
2024-04-01 14:56:14 +01:00
parent c724778cb3
commit aaf20445b4
+7
View File
@@ -1219,6 +1219,13 @@ ParsedFormat BufferFormatter::ParseFormatString(const QString &formatString, uin
break;
}
if(!isPointer && structContext.structDef.type.name == cur->structDef.type.name)
{
reportError(tr("Invalid nested struct declaration, only allowed for pointers."));
success = false;
break;
}
QString varName = structMatch.captured(3).trimmed();
if(varName.isEmpty())