From aaf20445b444874b8a15b224d6e68f9c2961a8d0 Mon Sep 17 00:00:00 2001 From: baldurk Date: Mon, 1 Apr 2024 14:56:14 +0100 Subject: [PATCH] Report error in the buffer formatter if a recursive struct is declared --- qrenderdoc/Code/BufferFormatter.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/qrenderdoc/Code/BufferFormatter.cpp b/qrenderdoc/Code/BufferFormatter.cpp index ba09a098b..638d5c4c2 100644 --- a/qrenderdoc/Code/BufferFormatter.cpp +++ b/qrenderdoc/Code/BufferFormatter.cpp @@ -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())