From 3ef11870222d6766277a6d0f7ebe130c75dc4492 Mon Sep 17 00:00:00 2001 From: firewave Date: Wed, 10 Jun 2026 13:13:30 +0200 Subject: [PATCH 1/2] use `std::vector` as underlying container for `std::stack` in `simplecpp::TokenList::combineOperators()` --- simplecpp.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/simplecpp.cpp b/simplecpp.cpp index fc145849..09582b60 100644 --- a/simplecpp.cpp +++ b/simplecpp.cpp @@ -1031,7 +1031,7 @@ static bool isAlternativeAndBitandBitor(const simplecpp::Token* tok) void simplecpp::TokenList::combineOperators() { - std::stack executableScope; + std::stack> executableScope; executableScope.push(false); for (Token *tok = front(); tok; tok = tok->next) { if (tok->op == '{') { From a80a3ea531f379865cdf0ef8087117d0f6839de0 Mon Sep 17 00:00:00 2001 From: firewave Date: Wed, 10 Jun 2026 13:15:54 +0200 Subject: [PATCH 2/2] initialize `std::stack` with intial value instead of inserting it in `simplecpp::TokenList::combineOperators()` --- simplecpp.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/simplecpp.cpp b/simplecpp.cpp index 09582b60..53baaa87 100644 --- a/simplecpp.cpp +++ b/simplecpp.cpp @@ -1031,8 +1031,7 @@ static bool isAlternativeAndBitandBitor(const simplecpp::Token* tok) void simplecpp::TokenList::combineOperators() { - std::stack> executableScope; - executableScope.push(false); + std::stack> executableScope{{false}}; for (Token *tok = front(); tok; tok = tok->next) { if (tok->op == '{') { if (executableScope.top()) {