From 70bb55d779a71729ec06d356184beaffbdd5dfd4 Mon Sep 17 00:00:00 2001 From: Brian Fiete Date: Wed, 21 May 2025 07:50:42 +0200 Subject: [PATCH] Fix for OOB issue in mActiveChildQueues --- IDEHelper/Compiler/BfPrinter.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/IDEHelper/Compiler/BfPrinter.cpp b/IDEHelper/Compiler/BfPrinter.cpp index f2da195a..103f4c9b 100644 --- a/IDEHelper/Compiler/BfPrinter.cpp +++ b/IDEHelper/Compiler/BfPrinter.cpp @@ -225,11 +225,11 @@ void BfPrinter::FlushVisitChild() while (childQueueState.mIdx < childQueueState.mQueue->mSize) { auto node = (*childQueueState.mQueue)[childQueueState.mIdx++]; - if (mActiveChildQueues.mSize > 1) + if (mActiveChildQueues.mSize >= 2) { // Check for nodes in the prev queue that are actual inside the new queue (can happen with inline type declarations) auto prevQueue = mActiveChildQueues[mActiveChildQueues.mSize - 2]; - while (true) + while (prevQueue->mIdx < prevQueue->mQueue->mSize) { auto prevQueueNode = (*prevQueue->mQueue)[prevQueue->mIdx]; if (prevQueueNode.mQueuedNode->mSrcStart >= node.mQueuedNode->mSrcStart)