diff --git a/lib/tokenize.cpp b/lib/tokenize.cpp index d431f1911..454fc2b7e 100644 --- a/lib/tokenize.cpp +++ b/lib/tokenize.cpp @@ -2309,8 +2309,8 @@ void Tokenizer::simplifyLabelsCaseDefault() break; if (tok->str() != "case" && tok->next() && tok->next()->str() == ":") { tok = tok->next(); - if (!tok->next()) - syntaxError(tok); // #7270 invalid code + if (!tok->next()) + syntaxError(tok); // #7270 invalid code if (tok->next()->str() != ";" && tok->next()->str() != "case") tok->insertToken(";"); else diff --git a/test/testgarbage.cpp b/test/testgarbage.cpp index 74f1ffe4b..d13e91142 100644 --- a/test/testgarbage.cpp +++ b/test/testgarbage.cpp @@ -219,7 +219,7 @@ private: TEST_CASE(garbageCode168); // #7246 TEST_CASE(garbageCode169); // #6731 TEST_CASE(garbageCode170); - TEST_CASE(garbageCode171); + TEST_CASE(garbageCode171); TEST_CASE(garbageValueFlow); TEST_CASE(garbageSymbolDatabase); TEST_CASE(garbageAST); @@ -1442,8 +1442,8 @@ private: // 7255 checkCode("d i(){{f*s=typeid(()0,)}}", false); } - - void garbageCode171() { + + void garbageCode171() { // 7270 ASSERT_THROW(checkCode("(){case()?():}:", false), InternalError); }