From 2bf2d1bd2adafa8b1187fe927c8724c944c2e700 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sun, 24 Jul 2016 08:51:35 +0200 Subject: [PATCH] bump simplecpp --- externals/simplecpp/simplecpp.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/externals/simplecpp/simplecpp.cpp b/externals/simplecpp/simplecpp.cpp index 1f6262943..b19255a99 100644 --- a/externals/simplecpp/simplecpp.cpp +++ b/externals/simplecpp/simplecpp.cpp @@ -1124,6 +1124,10 @@ private: if (argnr >= args.size()) return false; + // empty variadic parameter + if (variadic && argnr + 1U >= parametertokens.size()) + return true; + for (const Token *partok = parametertokens[argnr]->next; partok != parametertokens[argnr + 1U]; partok = partok->next) output->push_back(new Token(*partok)); @@ -1136,7 +1140,8 @@ private: const unsigned int argnr = getArgNum(tok->str); if (argnr >= args.size()) return false; - + if (variadic && argnr + 1U >= parametertokens.size()) // empty variadic parameter + return true; for (const Token *partok = parametertokens[argnr]->next; partok != parametertokens[argnr + 1U];) { const std::map::const_iterator it = macros.find(partok->str); if (it != macros.end() && expandedmacros1.find(partok->str) == expandedmacros1.end())